Struct cargo::core::resolver::Resolve

source ·
pub struct Resolve { /* private fields */ }
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.

Implementations§

source§

impl Resolve

source

pub fn new( graph: Graph<PackageId, HashSet<Dependency>>, replacements: HashMap<PackageId, PackageId>, features: HashMap<PackageId, Vec<InternedString>>, checksums: HashMap<PackageId, Option<String>>, metadata: Metadata, unused_patches: Vec<PackageId>, version: ResolveVersion, summaries: HashMap<PackageId, Summary> ) -> Resolve

source

pub fn path_to_top<'a>( &'a self, pkg: &'a PackageId ) -> Vec<(&'a PackageId, Option<&'a HashSet<Dependency>>)>

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

source

pub fn register_used_patches(&mut self, patches: &[Summary])

source

pub fn merge_from(&mut self, previous: &Resolve) -> CargoResult<()>

source

pub fn contains<Q>(&self, k: &Q) -> bool
where PackageId: Borrow<Q>, Q: Ord + Eq + ?Sized,

source

pub fn sort(&self) -> Vec<PackageId>

source

pub fn iter(&self) -> impl Iterator<Item = PackageId> + '_

source

pub fn deps( &self, pkg: PackageId ) -> impl Iterator<Item = (PackageId, &HashSet<Dependency>)>

source

pub fn deps_not_replaced( &self, pkg: PackageId ) -> impl Iterator<Item = (PackageId, &HashSet<Dependency>)>

source

pub fn replacement(&self, pkg: PackageId) -> Option<PackageId>

source

pub fn replacements(&self) -> &HashMap<PackageId, PackageId>

source

pub fn features(&self, pkg: PackageId) -> &[InternedString]

source

pub fn features_clone(&self) -> HashMap<PackageId, Vec<InternedString>>

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

source

pub fn is_public_dep(&self, pkg: PackageId, dep: PackageId) -> bool

source

pub fn query(&self, spec: &str) -> CargoResult<PackageId>

source

pub fn specs_to_ids( &self, specs: &[PackageIdSpec] ) -> CargoResult<Vec<PackageId>>

source

pub fn unused_patches(&self) -> &[PackageId]

source

pub fn checksums(&self) -> &HashMap<PackageId, Option<String>>

source

pub fn metadata(&self) -> &Metadata

source

pub fn extern_crate_name_and_dep_name( &self, from: PackageId, to: PackageId, to_target: &Target ) -> CargoResult<(InternedString, Option<InternedString>)>

source

pub fn version(&self) -> ResolveVersion

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

source

pub fn set_version(&mut self, version: ResolveVersion)

source

pub fn summary(&self, pkg_id: PackageId) -> &Summary

Trait Implementations§

source§

impl Debug for Resolve

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Resolve

source§

fn eq(&self, other: &Resolve) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Resolve

source§

fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize(&self, serializer: &mut dyn Serializer)

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more