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
pub fn entry_type(&self, package: &LocalPackageId) -> bool
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,
expected_rock_layout: Option<&RockLayoutConfig>,
) -> Result<Lockfile<ReadOnly>, LockfileError>
pub fn load( filepath: PathBuf, expected_rock_layout: Option<&RockLayoutConfig>, ) -> Result<Lockfile<ReadOnly>, LockfileError>
Load a Lockfile, failing if none exists.
If expected_rock_layout is Some, this fails if the rock layouts don’t match
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>
impl<P> RefUnwindSafe for Lockfile<P>where
P: RefUnwindSafe,
impl<P> Send for Lockfile<P>where
P: Send,
impl<P> Sync for Lockfile<P>where
P: Sync,
impl<P> Unpin for Lockfile<P>where
P: Unpin,
impl<P> UnsafeUnpin for Lockfile<P>
impl<P> UnwindSafe for Lockfile<P>where
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§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,
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.