struct RustResolver<'r, 'a, 'g, 'n> {
shared: &'r mut BindingResolver<'a, 'g, 'n>,
memberships: BTreeMap<String, Arc<Membership>>,
roots: BTreeMap<String, Arc<[RootCandidate]>>,
root_memberships: BTreeMap<String, Arc<RootMembershipIndex>>,
root_modules: BTreeMap<String, BTreeMap<String, Arc<BTreeMap<String, Vec<usize>>>>>,
slots: BTreeMap<String, Slots>,
queries: BTreeMap<Request, Arc<CallBindingResolution>>,
ambiguous: u32,
candidate_queries: BTreeMap<(String, *const [(usize, usize)], *const [usize], Option<String>), Arc<CallBindingResolution>>,
}Expand description
Bounded query caches reuse the existing source capture and entity hydration.
Fields§
Shared operation authority and budgets.
memberships: BTreeMap<String, Arc<Membership>>Each source membership is checked once.
roots: BTreeMap<String, Arc<[RootCandidate]>>Actual manifest target candidates are collected once.
root_memberships: BTreeMap<String, Arc<RootMembershipIndex>>Source-free root path/cause buckets are built once per owning manifest.
root_modules: BTreeMap<String, BTreeMap<String, Arc<BTreeMap<String, Vec<usize>>>>>Source slots are inspected lazily, only in queried ancestor directories.
slots: BTreeMap<String, Slots>Module/value slots indexed once per required source.
queries: BTreeMap<Request, Arc<CallBindingResolution>>Identical calls share one complete result and cause set.
ambiguous: u32Competing slots observed in the current complete root query.
candidate_queries: BTreeMap<(String, *const [(usize, usize)], *const [usize], Option<String>), Arc<CallBindingResolution>>Repeated local import groups share merged namespace outcomes.
Implementations§
Source§impl<'g> RustResolver<'_, '_, 'g, '_>
impl<'g> RustResolver<'_, '_, 'g, '_>
Sourcefn charge(&mut self, bytes: u64) -> Result<(), CliError>
fn charge(&mut self, bytes: u64) -> Result<(), CliError>
Account all additional caches under the operation’s existing memory boundary.
Sourcefn with_scratch<T>(
&mut self,
operation: impl FnOnce(&mut Self, &mut ResolverScratch) -> Result<(T, u64), CliError>,
) -> Result<T, CliError>
fn with_scratch<T>( &mut self, operation: impl FnOnce(&mut Self, &mut ResolverScratch) -> Result<(T, u64), CliError>, ) -> Result<T, CliError>
Release temporary construction on every exit and charge the completed owner once.
Sourcefn insert_cause(
&mut self,
causes: &mut CauseWorkspace<'_>,
key: &CanonicalResolutionKey,
) -> Result<(), CliError>
fn insert_cause( &mut self, causes: &mut CauseWorkspace<'_>, key: &CanonicalResolutionKey, ) -> Result<(), CliError>
Use the shared bounded cause owner for Rust-specific source traversal.
Sourcefn cause(
&mut self,
path: &str,
causes: &mut CauseWorkspace<'_>,
) -> Result<bool, CliError>
fn cause( &mut self, path: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<bool, CliError>
Missing paths remain invalidation causes, without attempting to read them.
Sourcefn insert_root(
&mut self,
scratch: &mut ResolverScratch,
roots: &mut BTreeMap<String, bool>,
path: String,
certain: bool,
) -> Result<(), CliError>
fn insert_root( &mut self, scratch: &mut ResolverScratch, roots: &mut BTreeMap<String, bool>, path: String, certain: bool, ) -> Result<(), CliError>
Preserve root certainty while reserving each new owned path before insertion.
Sourcefn source(
&mut self,
path: &str,
) -> Result<Option<Arc<BindingSource<'g>>>, CliError>
fn source( &mut self, path: &str, ) -> Result<Option<Arc<BindingSource<'g>>>, CliError>
Index complete native ownership facts once, sharing source/module payloads.
Sourcefn roots(
&mut self,
path: &str,
causes: &mut CauseWorkspace<'_>,
) -> Result<Arc<[RootCandidate]>, CliError>
fn roots( &mut self, path: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<Arc<[RootCandidate]>, CliError>
Gather roots from the owning manifest and admitted default target inventory.
Sourcefn root_membership_index(
&mut self,
path: &str,
roots: Arc<[RootCandidate]>,
) -> Result<Arc<RootMembershipIndex>, CliError>
fn root_membership_index( &mut self, path: &str, roots: Arc<[RootCandidate]>, ) -> Result<Arc<RootMembershipIndex>, CliError>
Bucket paths and negative causes without opening any candidate root source.
Sourcefn root_directory_modules(
&mut self,
path: &str,
index: &RootMembershipIndex,
directory: &str,
candidates: &RootDirectoryCandidates,
) -> Result<Arc<BTreeMap<String, Vec<usize>>>, CliError>
fn root_directory_modules( &mut self, path: &str, index: &RootMembershipIndex, directory: &str, candidates: &RootDirectoryCandidates, ) -> Result<Arc<BTreeMap<String, Vec<usize>>>, CliError>
Recover module slots once per relevant directory, leaving other roots unopened.
Sourcefn membership(&mut self, path: &str) -> Result<Arc<Membership>, CliError>
fn membership(&mut self, path: &str) -> Result<Arc<Membership>, CliError>
Prove membership through actual module declarations along a narrowed path.
Sourcefn declared_module(
&mut self,
owner: &Module,
name: &str,
causes: &mut CauseWorkspace<'_>,
) -> Result<Option<Module>, CliError>
fn declared_module( &mut self, owner: &Module, name: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<Option<Module>, CliError>
An external module requires one declaration and exactly one admitted layout.
Sourcefn address(
&mut self,
owner: &Module,
logical: &[String],
causes: &mut CauseWorkspace<'_>,
) -> Result<Option<Module>, CliError>
fn address( &mut self, owner: &Module, logical: &[String], causes: &mut CauseWorkspace<'_>, ) -> Result<Option<Module>, CliError>
Recover an actual containing module from its target root.
Sourcefn resolve_candidates(
&mut self,
source: &str,
facts: &SourceSemanticFacts,
call: &SourceRustCallImports,
) -> Result<Arc<CallBindingResolution>, CliError>
fn resolve_candidates( &mut self, source: &str, facts: &SourceSemanticFacts, call: &SourceRustCallImports, ) -> Result<Arc<CallBindingResolution>, CliError>
Merge only candidates from the actual winning import-only lexical group.
Sourcefn resolve(
&mut self,
request: Request,
) -> Result<Arc<CallBindingResolution>, CliError>
fn resolve( &mut self, request: Request, ) -> Result<Arc<CallBindingResolution>, CliError>
Resolve one complete call/import request and retain all failed-branch causes.
Sourcefn import_target(
&mut self,
namespace: Option<Selection>,
value: Option<Selection>,
) -> Result<Option<GraphEntity>, CliError>
fn import_target( &mut self, namespace: Option<Selection>, value: Option<Selection>, ) -> Result<Option<GraphEntity>, CliError>
Preserve external identities and exact dependency file owners independently.
Sourcefn external(&self, identity: &str) -> Result<GraphEntity, CliError>
fn external(&self, identity: &str) -> Result<GraphEntity, CliError>
Create a content-free toolchain identity only from source or target-edition proof.
Sourcefn path(
&mut self,
owner: &Module,
path: &SourceRustPath,
namespace: Namespace,
requester: &[String],
causes: &mut CauseWorkspace<'_>,
visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>,
depth: usize,
) -> Result<Option<Selection>, CliError>
fn path( &mut self, owner: &Module, path: &SourceRustPath, namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>
Resolve an explicit anchor before walking namespace members.
Sourcefn select(
&mut self,
owner: &Module,
parts: &[String],
namespace: Namespace,
requester: &[String],
causes: &mut CauseWorkspace<'_>,
visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>,
depth: usize,
) -> Result<Option<Selection>, CliError>
fn select( &mut self, owner: &Module, parts: &[String], namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>
Preserve duplicate slots and terminate cycles without narrowing partial proof.
Sourcefn select_inner(
&mut self,
owner: &Module,
parts: &[String],
namespace: Namespace,
requester: &[String],
causes: &mut CauseWorkspace<'_>,
visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>,
depth: usize,
) -> Result<Option<Selection>, CliError>
fn select_inner( &mut self, owner: &Module, parts: &[String], namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>
One namespace step checks visibility and source-owned competing bindings.
Auto Trait Implementations§
impl<'r, 'a, 'g, 'n> !RefUnwindSafe for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> !Send for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> !Sync for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> !UnwindSafe for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> Freeze for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> Unpin for RustResolver<'r, 'a, 'g, 'n>
impl<'r, 'a, 'g, 'n> UnsafeUnpin for RustResolver<'r, 'a, 'g, 'n>
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<'a, T> FromIn<'a, T> for T
impl<'a, T> FromIn<'a, T> for 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