pub struct NpmView { /* private fields */ }Expand description
Typed view over the npm sub-index. Built once; get is O(1).
Implementations§
Source§impl NpmView
impl NpmView
Sourcepub fn get(&self, name: &str, version: &str) -> Option<NpmPackage>
pub fn get(&self, name: &str, version: &str) -> Option<NpmPackage>
O(1) lookup → handle. None if the package is not in the archive. name
is the authoritative name (pass @scope/pkg for scoped packages).
Sourcepub fn list(&self) -> Vec<(String, String)>
pub fn list(&self) -> Vec<(String, String)>
Authoritative (name, version) coords of every package in the view.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for NpmView
impl RefUnwindSafe for NpmView
impl Send for NpmView
impl Sync for NpmView
impl Unpin for NpmView
impl UnsafeUnpin for NpmView
impl UnwindSafe for NpmView
Blanket Implementations§
impl<T> Allocation for T
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