pub enum Resolution {
Exact(NodeId),
SameFile(NodeId),
UniqueSuffix(NodeId),
ViaImport(NodeId),
SameDir(NodeId),
Ambiguous(Vec<NodeId>),
Unresolved,
}Expand description
How a reference was matched, ordered from most to least trustworthy.
The variant determines the confidence stamped on the resulting edge, so a downstream consumer can tell a certain call from an educated guess.
Variants§
Exact(NodeId)
Exact FQN match with exactly one definition.
SameFile(NodeId)
Matched a symbol defined in the referencing file.
UniqueSuffix(NodeId)
Suffix match with exactly one definition repo-wide.
ViaImport(NodeId)
Several candidates; the referencing file’s own import statement names exactly one module, and one candidate came from it.
Stronger evidence than SameDir: the author wrote down which module they
meant. Ranked accordingly in confidence.
SameDir(NodeId)
Several candidates; exactly one lives in the referencing file’s directory.
Ambiguous(Vec<NodeId>)
Several equally-plausible candidates, sorted deterministically.
Unresolved
No definition in this repository (external or stdlib).
Implementations§
Source§impl Resolution
impl Resolution
Sourcepub fn confidence(&self) -> f32
pub fn confidence(&self) -> f32
Confidence to stamp on an edge created from this resolution.
Ambiguous is deliberately low rather than zero: the reference does
point at something in the repo, we just cannot say which. Consumers
that need certainty should filter on this value.
Sourcepub fn candidates(&self) -> Vec<NodeId> ⓘ
pub fn candidates(&self) -> Vec<NodeId> ⓘ
Every candidate this resolution considered plausible.
pub fn is_resolved(&self) -> bool
Trait Implementations§
Source§impl Clone for Resolution
impl Clone for Resolution
Source§impl Debug for Resolution
impl Debug for Resolution
impl Eq for Resolution
Source§impl PartialEq for Resolution
impl PartialEq for Resolution
impl StructuralPartialEq for Resolution
Auto Trait Implementations§
impl Freeze for Resolution
impl RefUnwindSafe for Resolution
impl Send for Resolution
impl Sync for Resolution
impl Unpin for Resolution
impl UnsafeUnpin for Resolution
impl UnwindSafe for Resolution
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.