pub struct Lockfile {
pub version: ResolveVersion,
pub packages: Vec<Package>,
pub root: Option<Package>,
pub metadata: BTreeMap<MetadataKey, MetadataValue>,
pub patch: Patch,
}
Expand description
Parsed Cargo.lock file containing dependencies
Fields§
§version: ResolveVersion
Version of the Lockfile
packages: Vec<Package>
Dependencies enumerated in the lockfile
root: Option<Package>
Legacy “root” dependency for backwards compatibility
metadata: BTreeMap<MetadataKey, MetadataValue>
Package metadata
patch: Patch
Patches
Implementations§
source§impl Lockfile
impl Lockfile
sourcepub fn load(path: impl AsRef<Path>) -> Result<Lockfile, Error>
pub fn load(path: impl AsRef<Path>) -> Result<Lockfile, Error>
Load lock data from a Cargo.lock
file
sourcepub fn dependency_tree(&self) -> Result<Tree, Error>
pub fn dependency_tree(&self) -> Result<Tree, Error>
Get the dependency tree for this Lockfile
. Returns an error if the
contents of this lockfile aren’t well structured.
The dependency-tree
Cargo feature must be enabled to use this.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Lockfile
impl<'de> Deserialize<'de> for Lockfile
source§fn deserialize<D>(
deserializer: D
) -> Result<Lockfile, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Lockfile, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Lockfile
impl PartialEq for Lockfile
source§impl Serialize for Lockfile
impl Serialize for Lockfile
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Lockfile
impl StructuralEq for Lockfile
impl StructuralPartialEq for Lockfile
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.