pub struct Lockfile {
pub version: String,
pub metadata: Option<LockfileMetadata>,
pub packages: BTreeMap<String, LockedPackage>,
}Expand description
The lockfile (rx.lock)
Fields§
§version: StringLockfile format version
metadata: Option<LockfileMetadata>Metadata about the resolution
packages: BTreeMap<String, LockedPackage>Locked packages (sorted by name for deterministic output)
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn from_resolution(resolution: &Resolution) -> Self
pub fn from_resolution(resolution: &Resolution) -> Self
Create a lockfile from a resolution
Sourcepub fn to_resolution(&self) -> Resolution
pub fn to_resolution(&self) -> Resolution
Convert back to a Resolution for installation
Sourcepub fn dependency_graph(&self) -> BTreeMap<String, Vec<String>>
pub fn dependency_graph(&self) -> BTreeMap<String, Vec<String>>
Get the dependency graph as adjacency list
Sourcepub fn reverse_dependencies(&self, package: &str) -> Vec<String>
pub fn reverse_dependencies(&self, package: &str) -> Vec<String>
Get reverse dependencies (which packages depend on a given package)
Sourcepub fn get(&self, name: &str) -> Option<&LockedPackage>
pub fn get(&self, name: &str) -> Option<&LockedPackage>
Get a locked package by name
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 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