pub struct Lockfile {
pub version: u32,
pub created_at: String,
pub platform: String,
pub packages: BTreeMap<String, LockedPackage>,
}Expand description
A lockfile for reproducible package installations
Fields§
§version: u32Lockfile format version
created_at: StringWhen the lockfile was created
platform: StringPlatform this lockfile was created on
packages: BTreeMap<String, LockedPackage>Locked packages
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn add_package(&mut self, name: &str, package: LockedPackage)
pub fn add_package(&mut self, name: &str, package: LockedPackage)
Add or update a package
Sourcepub fn remove_package(&mut self, name: &str)
pub fn remove_package(&mut self, name: &str)
Remove a package
Sourcepub fn get_package(&self, name: &str) -> Option<&LockedPackage>
pub fn get_package(&self, name: &str) -> Option<&LockedPackage>
Get a package
Sourcepub fn matches_platform(&self) -> bool
pub fn matches_platform(&self) -> bool
Check if the lockfile matches the current platform
Sourcepub fn package_names(&self) -> impl Iterator<Item = &str>
pub fn package_names(&self) -> impl Iterator<Item = &str>
Get all package names
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lockfile
impl<'de> Deserialize<'de> for Lockfile
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 Freeze for Lockfile
impl RefUnwindSafe for Lockfile
impl Send for Lockfile
impl Sync for Lockfile
impl Unpin for Lockfile
impl UnsafeUnpin for Lockfile
impl UnwindSafe for Lockfile
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