pub struct RegistryQueryer<'a, T: Registry> {
inner: Rc<RegistryQueryerAsync<'a, T>>,
poller: LocalPollAdapter<'a, Rc<RegistryQueryerAsync<'a, T>>, (Dependency, Option<VersionOrdering>), CargoResult<Rc<Vec<Summary>>>>,
summary_cache: HashMap<(Option<PackageId>, Summary, ResolveOpts), (Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>, bool)>,
}Expand description
Wrapper around RegistryQueryerAsync that provides
caching and a Poll based interface using LocalPollAdapter.
Fields§
§inner: Rc<RegistryQueryerAsync<'a, T>>§poller: LocalPollAdapter<'a, Rc<RegistryQueryerAsync<'a, T>>, (Dependency, Option<VersionOrdering>), CargoResult<Rc<Vec<Summary>>>>§summary_cache: HashMap<(Option<PackageId>, Summary, ResolveOpts), (Rc<(HashSet<InternedString>, Rc<Vec<(Dependency, Rc<Vec<Summary>>, Rc<BTreeSet<InternedString>>)>>)>, bool)>a cache of Dependencys 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.
Implementations§
Source§impl<'a, T: Registry> RegistryQueryer<'a, T>
impl<'a, T: Registry> RegistryQueryer<'a, T>
pub fn new( registry: &'a T, replacements: &'a [(PackageIdSpec, Dependency)], version_prefs: &'a VersionPreferences, ) -> Self
pub fn registry(&self) -> &T
pub fn query( &mut self, dep: &Dependency, first_version: Option<VersionOrdering>, ) -> Poll<CargoResult<Rc<Vec<Summary>>>>
pub fn wait(&mut self) -> CargoResult<bool>
pub fn used_replacement_for( &self, p: PackageId, ) -> Option<(PackageId, PackageId)>
pub fn replacement_summary(&self, p: PackageId) -> Option<Summary>
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, T> !Freeze for RegistryQueryer<'a, T>
impl<'a, T> !RefUnwindSafe for RegistryQueryer<'a, T>
impl<'a, T> !Send for RegistryQueryer<'a, T>
impl<'a, T> !Sync for RegistryQueryer<'a, T>
impl<'a, T> Unpin for RegistryQueryer<'a, T>
impl<'a, T> UnsafeUnpin for RegistryQueryer<'a, T>
impl<'a, T> !UnwindSafe for RegistryQueryer<'a, T>
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>
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§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: 136 bytes