pub struct TypeNameRef<Ns: NameNamespace> { /* private fields */ }Expand description
A type-level reference to a named compiler entity.
Every semantic type reference has a canonical owner. Leaf-only names belong
at syntax/display boundaries; once a value crosses into the functional core,
it must carry a ResolvedName.
Implementations§
Source§impl<Ns: NameNamespace> TypeNameRef<Ns>
impl<Ns: NameNamespace> TypeNameRef<Ns>
Sourcepub fn from_resolved(resolved: ResolvedName<Ns>) -> Self
pub fn from_resolved(resolved: ResolvedName<Ns>) -> Self
Create a module-aware reference from a canonical resolved name.
Sourcepub const fn with_display_leaf(
name: NameDef<Ns>,
resolved: ResolvedName<Ns>,
) -> Self
pub const fn with_display_leaf( name: NameDef<Ns>, resolved: ResolvedName<Ns>, ) -> Self
Create a reference with a display leaf that differs from the canonical owner-qualified identity.
This is used at value-display boundaries such as tagged-union constructor values, where the semantic type is the owning union but the rendered value should show the constructor leaf.
Sourcepub fn with_owner(owner: DagId, name: NameDef<Ns>) -> Self
pub fn with_owner(owner: DagId, name: NameDef<Ns>) -> Self
Resolve a definition-site leaf into the given owner.
Sourcepub const fn name(&self) -> &NameDef<Ns>
pub const fn name(&self) -> &NameDef<Ns>
The leaf definition name used by registries and diagnostics.
Sourcepub const fn resolved(&self) -> &ResolvedName<Ns>
pub const fn resolved(&self) -> &ResolvedName<Ns>
The canonical owner/name identity.
Sourcepub fn matches_ref(&self, other: &Self) -> bool
pub fn matches_ref(&self, other: &Self) -> bool
Compare this reference against another type reference by owner-qualified identity.
Sourcepub fn to_unowned_name(&self) -> NameDef<Ns>
pub fn to_unowned_name(&self) -> NameDef<Ns>
Clone the leaf definition name for diagnostic/display boundaries.
Trait Implementations§
Source§impl<Ns: Clone + NameNamespace> Clone for TypeNameRef<Ns>
impl<Ns: Clone + NameNamespace> Clone for TypeNameRef<Ns>
Source§fn clone(&self) -> TypeNameRef<Ns>
fn clone(&self) -> TypeNameRef<Ns>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Ns: Debug + NameNamespace> Debug for TypeNameRef<Ns>
impl<Ns: Debug + NameNamespace> Debug for TypeNameRef<Ns>
Source§impl<Ns: NameNamespace> Display for TypeNameRef<Ns>
impl<Ns: NameNamespace> Display for TypeNameRef<Ns>
impl<Ns: Eq + NameNamespace> Eq for TypeNameRef<Ns>
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
Source§impl<Ns: Hash + NameNamespace> Hash for TypeNameRef<Ns>
impl<Ns: Hash + NameNamespace> Hash for TypeNameRef<Ns>
Source§impl<Ns: PartialEq + NameNamespace> PartialEq for TypeNameRef<Ns>
impl<Ns: PartialEq + NameNamespace> PartialEq for TypeNameRef<Ns>
Source§fn eq(&self, other: &TypeNameRef<Ns>) -> bool
fn eq(&self, other: &TypeNameRef<Ns>) -> bool
self and other values to be equal, and is used by ==.impl<Ns: NameNamespace> StructuralPartialEq for TypeNameRef<Ns>
Auto Trait Implementations§
impl<Ns> Freeze for TypeNameRef<Ns>
impl<Ns> RefUnwindSafe for TypeNameRef<Ns>where
Ns: RefUnwindSafe,
impl<Ns> Send for TypeNameRef<Ns>where
Ns: Send,
impl<Ns> Sync for TypeNameRef<Ns>where
Ns: Sync,
impl<Ns> Unpin for TypeNameRef<Ns>where
Ns: Unpin,
impl<Ns> UnsafeUnpin for TypeNameRef<Ns>
impl<Ns> UnwindSafe for TypeNameRef<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
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.