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
Source§impl<P: LockfilePermissions> Serialize for Lockfile<P>
impl<P: LockfilePermissions> Serialize for Lockfile<P>
Source§impl UserData for Lockfile<ReadOnly>
impl UserData for Lockfile<ReadOnly>
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Adds custom fields specific to this userdata.
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Registers this type for use in Lua. Read more
Source§impl UserData for Lockfile<ReadWrite>
impl UserData for Lockfile<ReadWrite>
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Adds custom fields specific to this userdata.
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Registers this type for use in Lua. 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> UnwindSafe for Lockfile<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
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> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.