pub struct Lockfile<P: LockfilePermissions> { /* private fields */ }Expand description
A lockfile for an install tree
Implementations§
Source§impl<P: LockfilePermissions> Lockfile<P>
impl<P: LockfilePermissions> Lockfile<P>
pub fn version(&self) -> &String
pub fn rocks(&self) -> &BTreeMap<LocalPackageId, LocalPackage>
pub fn is_dependency(&self, package: &LocalPackageId) -> bool
pub fn is_entrypoint(&self, package: &LocalPackageId) -> bool
Sourcepub fn entrypoint(&self, name: &PackageName) -> Option<&LocalPackage>
pub fn entrypoint(&self, name: &PackageName) -> Option<&LocalPackage>
Returns the entrypoint with the given package name, if any.
Sourcepub fn reachable_rocks(&self) -> Vec<LocalPackage>
pub fn reachable_rocks(&self) -> Vec<LocalPackage>
Returns all rocks in the lockfile that are reachable from an entrypoint via the dependency graph.
pub fn entry_type(&self, package: &LocalPackageId) -> EntryType
pub fn get(&self, id: &LocalPackageId) -> Option<&LocalPackage>
Sourcepub unsafe fn get_unchecked(&self, id: &LocalPackageId) -> &LocalPackage
pub unsafe fn get_unchecked(&self, id: &LocalPackageId) -> &LocalPackage
Unsafe because this assumes a prior check if the package is present
§Safety
Ensure that the package is present in the lockfile before calling this function.
Source§impl Lockfile<ReadOnly>
impl Lockfile<ReadOnly>
Sourcepub fn load(filepath: PathBuf) -> Result<Lockfile<ReadOnly>, LockfileError>
pub fn load(filepath: PathBuf) -> Result<Lockfile<ReadOnly>, LockfileError>
Load a Lockfile, failing if none exists.
Sourcepub fn write_guard(self) -> LockfileGuard
pub fn write_guard(self) -> LockfileGuard
Creates a lockfile guard, flushing the lockfile automatically once the guard goes out of scope.
Trait Implementations§
Source§impl<'de, P: LockfilePermissions> Deserialize<'de> for Lockfile<P>
impl<'de, P: LockfilePermissions> Deserialize<'de> for Lockfile<P>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<P> Freeze for Lockfile<P>where
PhantomData<P>: Freeze,
impl<P> RefUnwindSafe for Lockfile<P>where
PhantomData<P>: RefUnwindSafe,
impl<P> Send for Lockfile<P>where
PhantomData<P>: Send,
impl<P> Sync for Lockfile<P>where
PhantomData<P>: Sync,
impl<P> Unpin for Lockfile<P>where
PhantomData<P>: Unpin,
impl<P> UnsafeUnpin for Lockfile<P>where
PhantomData<P>: UnsafeUnpin,
impl<P> UnwindSafe for Lockfile<P>where
PhantomData<P>: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.