pub struct RegistryQueryer<'a> {
pub registry: &'a mut (dyn Registry + 'a),
replacements: &'a [(PackageIdSpec, Dependency)],
version_prefs: &'a VersionPreferences,
registry_cache: HashMap<(Dependency, Option<VersionOrdering>), 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
§registry_cache: HashMap<(Dependency, Option<VersionOrdering>), Poll<Rc<Vec<Summary>>>>
a cache of Candidate
s that fulfil a Dependency
(and whether first_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_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, ) -> 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_version: Option<VersionOrdering>,
) -> Poll<CargoResult<Rc<Vec<Summary>>>>
pub fn query( &mut self, dep: &Dependency, first_version: Option<VersionOrdering>, ) -> 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: &ResolverContext,
parent: Option<PackageId>,
candidate: &Summary,
opts: &ResolveOpts,
first_version: Option<VersionOrdering>,
) -> ActivateResult<Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>>
pub fn build_deps( &mut self, cx: &ResolverContext, parent: Option<PackageId>, candidate: &Summary, opts: &ResolveOpts, first_version: Option<VersionOrdering>, ) -> 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> Freeze for RegistryQueryer<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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: 184 bytes