pub struct ReferenceResolver { /* private fields */ }Expand description
Resolves references to target symbols and produces graph edges.
Implementations§
Source§impl ReferenceResolver
impl ReferenceResolver
Sourcepub fn add_symbols(&mut self, symbols: &[Symbol])
pub fn add_symbols(&mut self, symbols: &[Symbol])
Add symbols to the resolver’s index.
Sourcepub fn add_imports(&mut self, references: &[Reference])
pub fn add_imports(&mut self, references: &[Reference])
R2: Register import references so the resolver can prefer imported symbols.
Sourcepub fn resolve_with_confidence(
&self,
reference: &Reference,
) -> Option<(&Symbol, f64)>
pub fn resolve_with_confidence( &self, reference: &Reference, ) -> Option<(&Symbol, f64)>
Resolve a single reference to a target symbol with confidence.
Resolution strategy:
- Exact match on qualified name (confidence 1.0)
- R4: Cross-module path resolution — strip
crate::prefix, try partial matches - Simple name match with R2 scoring heuristics (confidence varies)
- Unresolved (returns None)
Sourcepub fn resolve_all(&self, references: &[Reference]) -> Vec<ResolvedEdge>
pub fn resolve_all(&self, references: &[Reference]) -> Vec<ResolvedEdge>
Resolve all references into edges.
Only produces edges for successfully resolved references.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReferenceResolver
impl RefUnwindSafe for ReferenceResolver
impl Send for ReferenceResolver
impl Sync for ReferenceResolver
impl Unpin for ReferenceResolver
impl UnsafeUnpin for ReferenceResolver
impl UnwindSafe for ReferenceResolver
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 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>
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