pub struct NpmResolutionCell { /* private fields */ }Expand description
Handles updating and storing npm resolution in memory.
This does not interact with the file system.
Implementations§
Source§impl NpmResolutionCell
impl NpmResolutionCell
pub fn from_serialized( initial_snapshot: Option<ValidSerializedNpmResolutionSnapshot>, ) -> Self
pub fn new(initial_snapshot: NpmResolutionSnapshot) -> Self
pub fn resolve_pkg_cache_folder_copy_index_from_pkg_id( &self, id: &NpmPackageId, ) -> Option<u8>
pub fn resolve_pkg_id_from_pkg_cache_folder_id( &self, id: &NpmPackageCacheFolderId, ) -> Result<NpmPackageId, PackageCacheFolderIdNotFoundError>
pub fn resolve_package_from_package( &self, name: &str, referrer: &NpmPackageCacheFolderId, ) -> Result<NpmResolutionPackage, Box<PackageNotFoundFromReferrerError>>
Sourcepub fn resolve_pkg_id_from_pkg_req(
&self,
req: &PackageReq,
) -> Result<NpmPackageId, PackageReqNotFoundError>
pub fn resolve_pkg_id_from_pkg_req( &self, req: &PackageReq, ) -> Result<NpmPackageId, PackageReqNotFoundError>
Resolve a node package from a deno module.
pub fn resolve_pkg_reqs_from_pkg_id(&self, id: &NpmPackageId) -> Vec<PackageReq>
pub fn resolve_pkg_id_from_deno_module( &self, id: &PackageNv, ) -> Result<NpmPackageId, PackageNvNotFoundError>
pub fn package_reqs(&self) -> Vec<(PackageReq, PackageNv)>
pub fn top_level_packages(&self) -> Vec<NpmPackageId>
pub fn any_top_level_package( &self, check: impl Fn(&NpmPackageId) -> bool, ) -> bool
pub fn all_system_packages( &self, system_info: &NpmSystemInfo, ) -> Vec<NpmResolutionPackage>
pub fn all_system_packages_partitioned( &self, system_info: &NpmSystemInfo, ) -> NpmPackagesPartitioned
pub fn snapshot(&self) -> NpmResolutionSnapshot
pub fn serialized_valid_snapshot(&self) -> ValidSerializedNpmResolutionSnapshot
pub fn serialized_valid_snapshot_for_system( &self, system_info: &NpmSystemInfo, ) -> ValidSerializedNpmResolutionSnapshot
pub fn subset(&self, package_reqs: &[PackageReq]) -> NpmResolutionSnapshot
pub fn set_snapshot(&self, snapshot: NpmResolutionSnapshot)
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Checks if the resolution is “pending” meaning that its current state requires an npm install to get it up to date. This occurs when the workspace config changes and deno_lockfile has incompletely updated the npm snapshot.
pub fn mark_pending(&self)
pub fn mark_not_pending(&self)
Trait Implementations§
Source§impl Debug for NpmResolutionCell
impl Debug for NpmResolutionCell
Auto Trait Implementations§
impl !Freeze for NpmResolutionCell
impl !RefUnwindSafe for NpmResolutionCell
impl Send for NpmResolutionCell
impl Sync for NpmResolutionCell
impl Unpin for NpmResolutionCell
impl UnsafeUnpin for NpmResolutionCell
impl UnwindSafe for NpmResolutionCell
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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSend for Twhere
T: ?Sized,
impl<T> MaybeSendSync for T
impl<T> MaybeSync for Twhere
T: ?Sized,
Source§impl<T> PathsInErrorsExt for Twhere
T: ?Sized,
impl<T> PathsInErrorsExt for Twhere
T: ?Sized,
Source§fn with_paths_in_errors(&self) -> SysWithPathsInErrors<'_, Self>
fn with_paths_in_errors(&self) -> SysWithPathsInErrors<'_, Self>
Wraps
self in a SysWithPathsInErrors that includes paths in error messages.