NpmResolutionSnapshot

Struct NpmResolutionSnapshot 

Source
pub struct NpmResolutionSnapshot { /* private fields */ }

Implementations§

Source§

impl NpmResolutionSnapshot

Source

pub fn new(snapshot: ValidSerializedNpmResolutionSnapshot) -> Self

Source

pub async fn add_pkg_reqs( self, api: &impl NpmRegistryApi, options: AddPkgReqsOptions<'_>, reporter: Option<&dyn Reporter>, ) -> AddPkgReqsResult

Resolves the provided package requirements adding them to the snapshot.

Source

pub fn subset(&self, package_reqs: &[PackageReq]) -> Self

Returns a new snapshot made from a subset of this snapshot’s package reqs. Requirements not present in this snapshot will be ignored.

Source

pub fn as_valid_serialized(&self) -> ValidSerializedNpmResolutionSnapshot

Gets the snapshot as a valid serialized snapshot.

Source

pub fn as_valid_serialized_for_system( &self, system_info: &NpmSystemInfo, ) -> ValidSerializedNpmResolutionSnapshot

Filters out any optional dependencies that don’t match for the given system. The resulting valid serialized snapshot will then not have any optional dependencies that don’t match the given system.

Source

pub fn is_empty(&self) -> bool

Gets if this snapshot is empty.

Source

pub fn into_empty(self) -> Self

Converts the snapshot into an empty snapshot.

Source

pub fn resolve_pkg_from_pkg_req( &self, req: &PackageReq, ) -> Result<&NpmResolutionPackage, PackageReqNotFoundError>

Resolve a package from a package requirement.

Source

pub fn resolve_pkg_from_pkg_cache_folder_id( &self, pkg_cache_folder_id: &NpmPackageCacheFolderId, ) -> Result<&NpmResolutionPackage, PackageCacheFolderIdNotFoundError>

Resolve a package from a package cache folder id.

Source

pub fn resolve_package_from_deno_module( &self, nv: &PackageNv, ) -> Result<&NpmResolutionPackage, PackageNvNotFoundError>

Resolve a package from a deno module.

Source

pub fn top_level_packages(&self) -> Values<'_, PackageNv, NpmPackageId>

Source

pub fn package_reqs(&self) -> &HashMap<PackageReq, PackageNv>

Source

pub fn package_from_id( &self, id: &NpmPackageId, ) -> Option<&NpmResolutionPackage>

Source

pub fn resolve_package_from_package( &self, name: &str, referrer: &NpmPackageCacheFolderId, ) -> Result<&NpmResolutionPackage, Box<PackageNotFoundFromReferrerError>>

Source

pub fn all_packages_for_every_system( &self, ) -> impl Iterator<Item = &NpmResolutionPackage>

Gets all the packages found in the snapshot regardless of whether they are supported on the current system.

Source

pub fn all_system_packages( &self, system_info: &NpmSystemInfo, ) -> Vec<NpmResolutionPackage>

Source

pub fn all_system_packages_partitioned( &self, system_info: &NpmSystemInfo, ) -> NpmPackagesPartitioned

Source

pub fn resolve_best_package_id( &self, name: &str, version_req: &VersionReq, ) -> Option<NpmPackageId>

Source

pub fn package_ids_for_nv<'a>( &'a self, nv: &'a PackageNv, ) -> impl Iterator<Item = &'a NpmPackageId>

Trait Implementations§

Source§

impl Clone for NpmResolutionSnapshot

Source§

fn clone(&self) -> NpmResolutionSnapshot

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NpmResolutionSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NpmResolutionSnapshot

Source§

fn default() -> NpmResolutionSnapshot

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,