pub struct RegistryQueryer<'a> {
pub registry: &'a mut (dyn Registry + 'a),
replacements: &'a [(PackageIdSpec, Dependency)],
version_prefs: &'a VersionPreferences,
minimal_versions: bool,
max_rust_version: Option<RustVersion>,
registry_cache: HashMap<(Dependency, bool), Poll<Rc<Vec<Summary>>>>,
summary_cache: HashMap<(Option<PackageId>, Summary, ResolveOpts), (Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>, bool)>,
used_replacements: HashMap<PackageId, Summary>,
}
Fields§
§registry: &'a mut (dyn Registry + 'a)
§replacements: &'a [(PackageIdSpec, Dependency)]
§version_prefs: &'a VersionPreferences
§minimal_versions: bool
If set the list of dependency candidates will be sorted by minimal
versions first. That allows cargo update -Z minimal-versions
which will
specify minimum dependency versions to be used.
max_rust_version: Option<RustVersion>
§registry_cache: HashMap<(Dependency, bool), Poll<Rc<Vec<Summary>>>>
a cache of Candidate
s that fulfil a Dependency
(and whether first_minimal_version
)
summary_cache: HashMap<(Option<PackageId>, Summary, ResolveOpts), (Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>, bool)>
a cache of Dependency
s that are required for a Summary
HACK: first_minimal_version
is not kept in the cache key is it is 1:1 with
parent.is_none()
(the first element of the cache key) as it doesn’t change through
execution.
used_replacements: HashMap<PackageId, Summary>
all the cases we ended up using a supplied replacement
Implementations§
source§impl<'a> RegistryQueryer<'a>
impl<'a> RegistryQueryer<'a>
pub fn new( registry: &'a mut dyn Registry, replacements: &'a [(PackageIdSpec, Dependency)], version_prefs: &'a VersionPreferences, minimal_versions: bool, max_rust_version: Option<&RustVersion> ) -> Self
pub fn reset_pending(&mut self) -> bool
pub fn used_replacement_for( &self, p: PackageId ) -> Option<(PackageId, PackageId)>
pub fn replacement_summary(&self, p: PackageId) -> Option<&Summary>
sourcepub fn query(
&mut self,
dep: &Dependency,
first_minimal_version: bool
) -> Poll<CargoResult<Rc<Vec<Summary>>>>
pub fn query( &mut self, dep: &Dependency, first_minimal_version: bool ) -> Poll<CargoResult<Rc<Vec<Summary>>>>
Queries the registry
to return a list of candidates for dep
.
This method is the location where overrides are taken into account. If any candidates are returned which match an override then the override is applied by performing a second query for what the override should return.
sourcepub fn build_deps(
&mut self,
cx: &Context,
parent: Option<PackageId>,
candidate: &Summary,
opts: &ResolveOpts,
first_minimal_version: bool
) -> ActivateResult<Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>>
pub fn build_deps( &mut self, cx: &Context, parent: Option<PackageId>, candidate: &Summary, opts: &ResolveOpts, first_minimal_version: bool ) -> ActivateResult<Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>>
Find out what dependencies will be added by activating candidate
,
with features described in opts
. Then look up in the registry
the candidates that will fulfil each of these dependencies, as it is the
next obvious question.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RegistryQueryer<'a>
impl<'a> !Send for RegistryQueryer<'a>
impl<'a> !Sync for RegistryQueryer<'a>
impl<'a> Unpin for RegistryQueryer<'a>
impl<'a> !UnwindSafe for RegistryQueryer<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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: 248 bytes