pub struct NpmRegistry {
http: HttpRegistry,
base: Url,
}Expand description
An npm registry answering GET {registry}/{package} with a packument.
A scoped name such as @scope/name is requested as @scope%2Fname. A 404
means no version exists. Retries and the token handling follow
CargoRegistry, with the token sent as
Authorization: Bearer <value>.
Fields§
§http: HttpRegistry§base: UrlImplementations§
Source§impl NpmRegistry
impl NpmRegistry
Sourcepub fn new(base: Url, token: Option<&Token>) -> Result<Self, RegistryError>
pub fn new(base: Url, token: Option<&Token>) -> Result<Self, RegistryError>
Look up packages under the registry base base.
A missing trailing slash on the path is added. Without a token,
requests are anonymous.
§Errors
Fails when the token is not a valid header value or the HTTP client cannot start.
Trait Implementations§
Source§impl Debug for NpmRegistry
impl Debug for NpmRegistry
Source§impl PackageRegistry for NpmRegistry
impl PackageRegistry for NpmRegistry
Auto Trait Implementations§
impl !Freeze for NpmRegistry
impl !RefUnwindSafe for NpmRegistry
impl !UnwindSafe for NpmRegistry
impl Send for NpmRegistry
impl Sync for NpmRegistry
impl Unpin for NpmRegistry
impl UnsafeUnpin for NpmRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more