[][src]Struct cargo_lock::lockfile::Lockfile

pub struct Lockfile {
    pub packages: Vec<Package>,
    pub metadata: Metadata,
}

Parsed Cargo.lock file containing dependencies

Fields

packages: Vec<Package>

Dependencies enumerated in the lockfile

metadata: Metadata

Package metadata

Methods

impl Lockfile[src]

pub fn load(path: impl AsRef<Path>) -> Result<Self, Error>[src]

Load lock data from a Cargo.lock file

pub fn root_package(&self) -> &Package[src]

Get the root Package in this Lockfile

pub fn dependent_packages(&self, package: &Package) -> Vec<&Package>[src]

Enumerate dependent Package types for the given parent Package.

pub fn dependency_tree(&self) -> Result<Tree, Error>[src]

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

impl Eq for Lockfile[src]

impl Clone for Lockfile[src]

impl PartialEq<Lockfile> for Lockfile[src]

impl ToString for Lockfile[src]

impl Debug for Lockfile[src]

impl FromStr for Lockfile[src]

type Err = Error

The associated error which can be returned from parsing.

impl Serialize for Lockfile[src]

impl<'de> Deserialize<'de> for Lockfile[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]