Struct cargo::core::resolver::Resolve

source ·
pub struct Resolve {
    graph: Graph<PackageId, HashSet<Dependency>>,
    replacements: HashMap<PackageId, PackageId>,
    reverse_replacements: HashMap<PackageId, PackageId>,
    features: HashMap<PackageId, Vec<InternedString>>,
    checksums: HashMap<PackageId, Option<String>>,
    metadata: Metadata,
    unused_patches: Vec<PackageId>,
    public_dependencies: HashMap<PackageId, HashSet<PackageId>>,
    version: ResolveVersion,
    summaries: HashMap<PackageId, Summary>,
}
Expand description

Represents a fully-resolved package dependency graph. Each node in the graph is a package and edges represent dependencies between packages.

Each instance of Resolve also understands the full set of features used for each package.

Fields§

§graph: Graph<PackageId, HashSet<Dependency>>

A graph, whose vertices are packages and edges are dependency specifications from Cargo.toml. We need a HashSet here because the same package might be present in both [dependencies] and [build-dependencies].

§replacements: HashMap<PackageId, PackageId>

Replacements from the [replace] table.

§reverse_replacements: HashMap<PackageId, PackageId>

Inverted version of replacements.

§features: HashMap<PackageId, Vec<InternedString>>

Features enabled for a given package.

§checksums: HashMap<PackageId, Option<String>>

Checksum for each package. A SHA256 hash of the .crate file used to validate the correct crate file is used. This is None for sources that do not use .crate files, like path or git dependencies.

§metadata: Metadata

“Unknown” metadata. This is a collection of extra, unrecognized data found in the [metadata] section of Cargo.lock, preserved for forwards compatibility.

§unused_patches: Vec<PackageId>

[patch] entries that did not match anything, preserved in Cargo.lock as the [[patch.unused]] table array. Tracking unused patches helps prevent Cargo from being forced to re-update the registry every time it runs, and keeps the resolve in a locked state so it doesn’t re-resolve the unused entries.

§public_dependencies: HashMap<PackageId, HashSet<PackageId>>

A map from packages to a set of their public dependencies

§version: ResolveVersion

Version of the Cargo.lock format, see cargo::core::resolver::encode for more.

§summaries: HashMap<PackageId, Summary>

Implementations§

Resolves one of the paths from the given dependent package up to the root.

This is only here for legacy support, it will be removed when switching to the new feature resolver.

Returns the version of the encoding that’s being used for this lock file.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 360 bytes