Skip to main content

BindingResolver

Struct BindingResolver 

Source
struct BindingResolver<'a, 'g, 'n> {
Show 19 fields store: &'a AtlasStore, project: ProjectInstanceId, generation: IndexGeneration, base_generation: Option<IndexGeneration>, graphs: BTreeMap<&'g str, (&'g SymbolGraph, Option<&'g SourceSemanticFacts>)>, entities: &'g EntityProjection, packages: &'a PackageIndex, configured: &'a ConfiguredModuleResolution, sources: &'a mut SourceBindingCache<'n>, candidates: &'a mut ProjectResolutionRegistry, replaced: &'a BTreeSet<String>, loaded: Option<BTreeSet<CanonicalResolutionKey>>, context: BTreeMap<String, Arc<BindingSource<'g>>>, hydrated: BTreeMap<String, Option<GraphEntity>>, modules: ModuleInterner, queries: BTreeMap<BindingQuery, BTreeMap<usize, Arc<CallBindingResolution>>>, retained_bytes: u64, retained_limit: u64, control: &'a IndexWorkControl,
}
Expand description

One operation’s source/query caches and existing repository resolution registry.

Fields§

§store: &'a AtlasStore

Existing read authority; no source parsing occurs inside a writer transaction.

§project: ProjectInstanceId

Selected project and pending generation.

§generation: IndexGeneration

Pending publication generation.

§base_generation: Option<IndexGeneration>

Exact graph entity generation available before this publication.

§graphs: BTreeMap<&'g str, (&'g SymbolGraph, Option<&'g SourceSemanticFacts>)>

Current source graphs paired with their own parser evidence.

§entities: &'g EntityProjection

Existing admitted entities and projection keys.

§packages: &'a PackageIndex

Existing package and configured-module owners.

§configured: &'a ConfiguredModuleResolution

One validated configuration snapshot shared with ordinary resolution.

§sources: &'a mut SourceBindingCache<'n>

Existing hash-checked, accounted source recovery owner.

§candidates: &'a mut ProjectResolutionRegistry

Existing candidate lookup owner, extended only for explicitly requested keys.

§replaced: &'a BTreeSet<String>

Paths replaced by the pending publication must not re-enter through old rows.

§loaded: Option<BTreeSet<CanonicalResolutionKey>>

Complete candidate keys already fetched in an incremental operation.

§context: BTreeMap<String, Arc<BindingSource<'g>>>

Captured source views, including borrowed fresh evidence.

§hydrated: BTreeMap<String, Option<GraphEntity>>

Exact target hydration cached by stable identity, including absent owners.

§modules: ModuleInterner

Canonical IDs and retained allocation witnesses for this resolver only.

§queries: BTreeMap<BindingQuery, BTreeMap<usize, Arc<CallBindingResolution>>>

Finished outcomes shared by repeated identical binding queries.

§retained_bytes: u64

Conservative bytes owned by this resolver’s additional indexes and outcomes.

§retained_limit: u64

Existing staging ceiling, injectable per owner for deterministic boundary tests.

§control: &'a IndexWorkControl

Shared indexing deadline, cancellation and work budget.

Implementations§

Source§

impl<'g> BindingResolver<'_, 'g, '_>

Source

fn query( &mut self, source: &str, reference: &ImportReference, member: Option<&str>, ) -> Result<BindingQuery, CliError>

Bind every query to this resolver’s IDs and reserve retained metadata atomically.

Source

fn check_budget(&self) -> Result<(), CliError>

Include every simultaneously live owner in the staging memory boundary.

Source

fn retained_staging_bytes(&self) -> u64

Sum accounted owners without changing their reservation state.

Source

fn reserve_scratch(&mut self, bytes: u64) -> Result<(), CliError>

Admit a temporary owner before allocating, retaining prior accounting on refusal.

Source

fn release_scratch(&mut self, bytes: u64) -> Result<(), CliError>

Release exactly one admitted temporary owner without erasing persistent state.

Source

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 retain the completed owner once.

Source

fn insert_cause( &mut self, causes: &mut CauseWorkspace<'_>, key: &CanonicalResolutionKey, ) -> Result<(), CliError>

Retain only a new key, checking both row and byte admission before cloning.

Source

fn source(&mut self, path: &str) -> Result<Arc<BindingSource<'g>>, CliError>

Load one explicitly needed source, reusing fresh facts and captured bytes.

Source

fn module_file( &mut self, keys: &[CanonicalResolutionKey], ) -> Result<Option<String>, CliError>

Fetch each additional canonical lookup once under the existing bounded API.

Source

fn resolve( &mut self, query: BindingQuery, visited: &mut BTreeMap<BindingQuery, usize>, depth: usize, ) -> Result<Arc<CallBindingResolution>, CliError>

Follow explicit module slots; a cycle, ambiguity or unsupported value abstains.

Source

fn target( &mut self, source: &BindingSource<'_>, index: usize, ) -> Result<Option<GraphEntity>, CliError>

Hydrate the exact existing canonical declaration selected by admitted source ordinals.

Auto Trait Implementations§

§

impl<'a, 'g, 'n> !RefUnwindSafe for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> !Send for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> !Sync for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> !UnwindSafe for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> Freeze for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> Unpin for BindingResolver<'a, 'g, 'n>

§

impl<'a, 'g, 'n> UnsafeUnpin for BindingResolver<'a, 'g, 'n>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'a, T> FromIn<'a, T> for T

§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more