pub struct ResolvedName<Ns: NameNamespace> { /* private fields */ }Expand description
A fully resolved reference in a semantic namespace.
Unlike NamePath, this no longer stores source qualifier text. The
owner is the canonical DAG/module identity chosen by module-aware
resolution; name is the declaration leaf inside that owner.
Implementations§
Source§impl<Ns: NameNamespace> ResolvedName<Ns>
impl<Ns: NameNamespace> ResolvedName<Ns>
Sourcepub const fn new(owner: DagId, name: NameAtom) -> Self
pub const fn new(owner: DagId, name: NameAtom) -> Self
Construct a resolved name from its canonical owner and leaf atom.
Sourcepub fn from_def(owner: DagId, name: NameDef<Ns>) -> Self
pub fn from_def(owner: DagId, name: NameDef<Ns>) -> Self
Resolve an existing definition-site name into a canonical owner.
Sourcepub const fn atom(&self) -> &NameAtom
pub const fn atom(&self) -> &NameAtom
The leaf atom inside Self::owner.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The leaf string inside Self::owner.
Sourcepub fn to_unowned_def_name(&self) -> NameDef<Ns>
pub fn to_unowned_def_name(&self) -> NameDef<Ns>
Return the unowned definition-site leaf in the same namespace.
This deliberately drops the canonical owner. Use it only at explicit
standalone registry, diagnostic, or serialization boundaries that
cannot yet carry ResolvedName itself.
Sourcepub fn into_parts(self) -> (DagId, NameAtom)
pub fn into_parts(self) -> (DagId, NameAtom)
Consume this value and return the canonical owner plus leaf atom.
Trait Implementations§
Source§impl<Ns: Clone + NameNamespace> Clone for ResolvedName<Ns>
impl<Ns: Clone + NameNamespace> Clone for ResolvedName<Ns>
Source§fn clone(&self) -> ResolvedName<Ns>
fn clone(&self) -> ResolvedName<Ns>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Ns: NameNamespace> Debug for ResolvedName<Ns>
impl<Ns: NameNamespace> Debug for ResolvedName<Ns>
Source§impl<Ns: NameNamespace> Display for ResolvedName<Ns>
impl<Ns: NameNamespace> Display for ResolvedName<Ns>
impl<Ns: Eq + NameNamespace> Eq for ResolvedName<Ns>
Source§impl From<ResolvedName<Index>> for IndexTypeRef
impl From<ResolvedName<Index>> for IndexTypeRef
Source§fn from(resolved: ResolvedName<Index>) -> Self
fn from(resolved: ResolvedName<Index>) -> Self
Converts to this type from the input type.
Source§impl<Ns: NameNamespace> From<ResolvedName<Ns>> for TypeNameRef<Ns>
impl<Ns: NameNamespace> From<ResolvedName<Ns>> for TypeNameRef<Ns>
Source§fn from(resolved: ResolvedName<Ns>) -> Self
fn from(resolved: ResolvedName<Ns>) -> Self
Converts to this type from the input type.
Source§impl<Ns: Hash + NameNamespace> Hash for ResolvedName<Ns>
impl<Ns: Hash + NameNamespace> Hash for ResolvedName<Ns>
Source§impl<Ns: Ord + NameNamespace> Ord for ResolvedName<Ns>
impl<Ns: Ord + NameNamespace> Ord for ResolvedName<Ns>
Source§fn cmp(&self, other: &ResolvedName<Ns>) -> Ordering
fn cmp(&self, other: &ResolvedName<Ns>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Ns: PartialEq + NameNamespace> PartialEq for ResolvedName<Ns>
impl<Ns: PartialEq + NameNamespace> PartialEq for ResolvedName<Ns>
Source§fn eq(&self, other: &ResolvedName<Ns>) -> bool
fn eq(&self, other: &ResolvedName<Ns>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Ns: PartialOrd + NameNamespace> PartialOrd for ResolvedName<Ns>
impl<Ns: PartialOrd + NameNamespace> PartialOrd for ResolvedName<Ns>
impl<Ns: NameNamespace> StructuralPartialEq for ResolvedName<Ns>
Auto Trait Implementations§
impl<Ns> Freeze for ResolvedName<Ns>
impl<Ns> RefUnwindSafe for ResolvedName<Ns>where
Ns: RefUnwindSafe,
impl<Ns> Send for ResolvedName<Ns>where
Ns: Send,
impl<Ns> Sync for ResolvedName<Ns>where
Ns: Sync,
impl<Ns> Unpin for ResolvedName<Ns>where
Ns: Unpin,
impl<Ns> UnsafeUnpin for ResolvedName<Ns>
impl<Ns> UnwindSafe for ResolvedName<Ns>where
Ns: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.