pub struct Resolution {
pub config: Config,
pub snapshot: Snapshot,
pub index: PackageIndex<Shared>,
pub index_packages: HashMap<Id, Vec<SemVer>>,
}Expand description
Stores the result of resolving version constraints to exact versions.
Fields§
§config: Config§snapshot: SnapshotThe snapshot (of path and git packages) that was used to construct this resolution. Note that path and git packages are not “resolved”; they have fixed versions. The snapshot is only used to collect index dependencies of git and path packages.
index: PackageIndex<Shared>§index_packages: HashMap<Id, Vec<SemVer>>All the index packages in the dependency tree.
Each package id can resolve to multiple versions, but those versions should all fall into disjoint semantic-version buckets.
Implementations§
Source§impl Resolution
impl Resolution
Sourcepub fn precise(&self, dep: &Dependency) -> PrecisePkg
pub fn precise(&self, dep: &Dependency) -> PrecisePkg
Finds the precise resolved version of this dependency.
§Panics
Panics if the dependency was not part of the dependency tree that this resolution was generated for.
Sourcepub fn sorted_dependencies(
&self,
pkg: &PrecisePkg,
) -> Result<Vec<(Ident, Dependency, PrecisePkg)>, Error>
pub fn sorted_dependencies( &self, pkg: &PrecisePkg, ) -> Result<Vec<(Ident, Dependency, PrecisePkg)>, Error>
Returns the dependencies of a package.
§Panics
Panics if the package was not part of the dependency tree that this resolution was generated for.
Sourcepub fn package_map(&self, manifest: &ManifestFile) -> Result<PackageMap, Error>
pub fn package_map(&self, manifest: &ManifestFile) -> Result<PackageMap, Error>
Returns a package map containing the entire dependency tree.
Sourcepub fn dependencies(
&self,
pkg: &PrecisePkg,
) -> Result<HashMap<Ident, PrecisePkg>, Error>
pub fn dependencies( &self, pkg: &PrecisePkg, ) -> Result<HashMap<Ident, PrecisePkg>, Error>
Returns all the dependencies of a package, along with their package-local names.
Sourcepub fn all_packages(&self) -> Vec<PrecisePkg>
pub fn all_packages(&self) -> Vec<PrecisePkg>
Returns all the resolved packages in the dependency tree.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Resolution
impl !RefUnwindSafe for Resolution
impl !Sync for Resolution
impl Send for Resolution
impl Unpin for Resolution
impl UnsafeUnpin for Resolution
impl UnwindSafe for Resolution
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more