pub struct SemanticLayer { /* private fields */ }Expand description
The resolve-time consumption path’s built-once layer: freshness, plus a
(file, name_line, member) compatibility join index over every admitted
occurrence, with identity translation applied lazily per lookup. Built by
load.
Implementations§
Source§impl SemanticLayer
impl SemanticLayer
Sourcepub fn load(root: &Path) -> Option<SemanticLayer>
pub fn load(root: &Path) -> Option<SemanticLayer>
Reads this checkout’s admitted compiler-facts artifact and builds the
layer. None when no artifact is admitted (the ordinary “no engine
ever ran here” state) or its bytes do not parse as this module
expects; both are fail-open, not errors – the whole run proceeds as
a syntax-only build.
Sourcepub fn is_fresh(&self) -> bool
pub fn is_fresh(&self) -> bool
Whether the whole artifact is fresh – consulted once per map run,
not per reference.
Sourcepub fn site_keys(&self) -> impl Iterator<Item = &(String, usize, String)>
pub fn site_keys(&self) -> impl Iterator<Item = &(String, usize, String)>
Every distinct (file, name_line, member) compatibility key this
layer indexes – discovered.rs’s own iteration surface, walked once
per admitted artifact rather than once per extractor reference.
Sourcepub fn lookup(
&self,
index: &DefIndex,
file: &str,
line: usize,
member: &str,
caller_arg_count: Option<usize>,
) -> LookupOutcome
pub fn lookup( &self, index: &DefIndex, file: &str, line: usize, member: &str, caller_arg_count: Option<usize>, ) -> LookupOutcome
Looks up the compatibility join key (file, name_line, member).
Freshness is checked first (a stale artifact never confirms anything,
regardless of what any individual site says). More than one matching
site is not automatically an ambiguity: caller_arg_count, the
reference’s own argument count when the call syntax carries one
(None for a property read, which never disambiguates), is compared
against each candidate’s target_overload_signature – the exact
identity carried alongside this compatibility key, not folded into
it. When exactly one candidate’s own arity matches, that candidate
alone is resolved, the same way a single hit would be; two same-line
overloads of one member survive as distinct facts through this path
rather than collapsing together. Only when arity cannot narrow the
set to one (no caller arg count, no signature, more than one
survivor, or a genuine tie) do disagreeing targets collapse to an
ambiguous outcome rather than picking one arbitrarily – the key is
a compatibility join, not the fact’s own identity, so more than one
unresolved hit at it is a real ambiguity this consumer introduces,
not one the compiler itself reported.
Auto Trait Implementations§
impl Freeze for SemanticLayer
impl RefUnwindSafe for SemanticLayer
impl Send for SemanticLayer
impl Sync for SemanticLayer
impl Unpin for SemanticLayer
impl UnsafeUnpin for SemanticLayer
impl UnwindSafe for SemanticLayer
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> 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