pub struct Lockfile {
pub version: u32,
pub packages: Vec<LockedPackage>,
}Expand description
A parsed bock.lock lockfile.
Fields§
§version: u32Lockfile format version.
packages: Vec<LockedPackage>Locked package entries, keyed by package name.
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn from_resolved(resolved: &BTreeMap<String, Version>) -> Self
pub fn from_resolved(resolved: &BTreeMap<String, Version>) -> Self
Create a new lockfile from resolved dependencies.
Sourcepub fn from_file(path: &Path) -> Result<Self, PkgError>
pub fn from_file(path: &Path) -> Result<Self, PkgError>
Read and parse a lockfile from a file path.
Sourcepub fn to_toml_string(&self) -> Result<String, PkgError>
pub fn to_toml_string(&self) -> Result<String, PkgError>
Serialize the lockfile to a TOML string.
Sourcepub fn get_version(&self, name: &str) -> Option<&str>
pub fn get_version(&self, name: &str) -> Option<&str>
Get the locked version of a specific package.
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
impl StructuralPartialEq for Lockfile
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