pub enum IndexTypeRef {
Declared(TypeNameRef<Index>),
NatRange(NatRangeIndexRef),
}Expand description
Type-level reference to an index definition.
Declared indexes are owner-qualified names. Compiler-generated range(N)
axes are typed Nat-range identities and do not have declared resolved names.
Variants§
Declared(TypeNameRef<Index>)
NatRange(NatRangeIndexRef)
Implementations§
Source§impl IndexTypeRef
impl IndexTypeRef
Sourcepub fn from_resolved(resolved: ResolvedName<Index>) -> Self
pub fn from_resolved(resolved: ResolvedName<Index>) -> Self
Create a module-aware reference from a canonical resolved declared-index name.
Sourcepub fn with_owner(owner: DagId, name: NameDef<Index>) -> Self
pub fn with_owner(owner: DagId, name: NameDef<Index>) -> Self
Resolve a declared-index definition-site leaf into the given owner.
Sourcepub const fn with_display_leaf(
name: NameDef<Index>,
resolved: ResolvedName<Index>,
) -> Self
pub const fn with_display_leaf( name: NameDef<Index>, resolved: ResolvedName<Index>, ) -> Self
Create a reference with a display leaf that differs from the canonical owner-qualified identity.
Sourcepub const fn from_nat_range(index: NatRangeIndex) -> Self
pub const fn from_nat_range(index: NatRangeIndex) -> Self
Create a concrete compiler-generated Nat range reference.
Sourcepub fn from_nat_range_form(
form: NatPolyForm,
) -> Result<Self, NatRangeIndexError>
pub fn from_nat_range_form( form: NatPolyForm, ) -> Result<Self, NatRangeIndexError>
Create a Nat range reference from a normalized Nat form.
§Errors
Returns an error when the form is a concrete invalid Nat range size.
Sourcepub const fn from_nat_range_ref(reference: NatRangeIndexRef) -> Self
pub const fn from_nat_range_ref(reference: NatRangeIndexRef) -> Self
Wrap an already validated Nat range reference.
Sourcepub const fn declared_name(&self) -> Option<&NameDef<Index>>
pub const fn declared_name(&self) -> Option<&NameDef<Index>>
The declared leaf name, when this is a declared index.
Sourcepub const fn declared_resolved(&self) -> Option<&ResolvedName<Index>>
pub const fn declared_resolved(&self) -> Option<&ResolvedName<Index>>
The canonical declared owner/name identity, when this is a declared index.
Sourcepub const fn nat_range_ref(&self) -> Option<&NatRangeIndexRef>
pub const fn nat_range_ref(&self) -> Option<&NatRangeIndexRef>
Return the Nat range reference, when this is a compiler-generated Nat range.
Sourcepub const fn nat_range(&self) -> Option<NatRangeIndex>
pub const fn nat_range(&self) -> Option<NatRangeIndex>
Return the typed concrete Nat range identity, if this reference has one.
Sourcepub fn nat_range_form(&self) -> Option<NatPolyForm>
pub fn nat_range_form(&self) -> Option<NatPolyForm>
Return the normalized Nat form, when this is a Nat range reference.
Sourcepub fn display_name(&self) -> NameDef<Index>
pub fn display_name(&self) -> NameDef<Index>
Render a display-only leaf name for diagnostics and formatting.
Sourcepub fn matches_ref(&self, other: &Self) -> bool
pub fn matches_ref(&self, other: &Self) -> bool
Compare this reference against another type reference.
Sourcepub fn to_unowned_name(&self) -> NameDef<Index>
pub fn to_unowned_name(&self) -> NameDef<Index>
Clone the leaf definition/display name for diagnostic/display boundaries.
Trait Implementations§
Source§impl Clone for IndexTypeRef
impl Clone for IndexTypeRef
Source§fn clone(&self) -> IndexTypeRef
fn clone(&self) -> IndexTypeRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndexTypeRef
impl Debug for IndexTypeRef
Source§impl Display for IndexTypeRef
impl Display for IndexTypeRef
impl Eq for IndexTypeRef
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
Source§impl Hash for IndexTypeRef
impl Hash for IndexTypeRef
Source§impl PartialEq for IndexTypeRef
impl PartialEq for IndexTypeRef
Source§fn eq(&self, other: &IndexTypeRef) -> bool
fn eq(&self, other: &IndexTypeRef) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for IndexTypeRef
Auto Trait Implementations§
impl Freeze for IndexTypeRef
impl RefUnwindSafe for IndexTypeRef
impl Send for IndexTypeRef
impl Sync for IndexTypeRef
impl Unpin for IndexTypeRef
impl UnsafeUnpin for IndexTypeRef
impl UnwindSafe for IndexTypeRef
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.