pub struct VersionPreferences { /* private fields */ }
Expand description

A collection of preferences for particular package versions.

This is built up with [prefer_package_id] and [prefer_dep], then used to sort the set of summaries for a package during resolution via [sort_summaries].

As written, a version is either “preferred” or “not preferred”. Later extensions may introduce more granular preferences.

Implementations

Indicate that the given package (specified as a PackageId) should be preferred.

Indicate that the given package (specified as a Dependency) should be preferred.

Sort the given vector of summaries in-place, with all summaries presumed to be for the same package. Preferred versions appear first in the result, sorted by version_ordering, followed by non-preferred versions sorted the same way.

Trait Implementations

Returns the “default value” for a type. 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.