pub struct NatRangeIndex { /* private fields */ }Expand description
Typed identity for a concrete compiler-generated Nat range index.
The core carries this non-zero size directly; display names are derived only
for diagnostics and compatibility with APIs that still need an IndexName.
Implementations§
Source§impl NatRangeIndex
impl NatRangeIndex
Sourcepub const fn new(size: NonZeroUsize) -> Self
pub const fn new(size: NonZeroUsize) -> Self
Create an identity for a non-empty Nat range index.
Sourcepub fn try_from_u64(size: u64) -> Result<Self, NatRangeIndexError>
pub fn try_from_u64(size: u64) -> Result<Self, NatRangeIndexError>
Try to create an identity from an AST/runtime u64 size.
§Errors
Returns an error when size is zero or cannot fit in usize on this target.
Sourcepub const fn size(self) -> NonZeroUsize
pub const fn size(self) -> NonZeroUsize
Return the non-zero in-memory size.
Sourcepub fn size_u64(self) -> u64
pub fn size_u64(self) -> u64
Return the size as a u64 for Nat-expression comparisons and display.
Sourcepub fn display_name(self) -> IndexName
pub fn display_name(self) -> IndexName
Render this identity for diagnostics as source-level range(N) syntax.
Trait Implementations§
Source§impl Clone for NatRangeIndex
impl Clone for NatRangeIndex
Source§fn clone(&self) -> NatRangeIndex
fn clone(&self) -> NatRangeIndex
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 moreimpl Copy for NatRangeIndex
Source§impl Debug for NatRangeIndex
impl Debug for NatRangeIndex
impl Eq for NatRangeIndex
Source§impl Hash for NatRangeIndex
impl Hash for NatRangeIndex
Source§impl Ord for NatRangeIndex
impl Ord for NatRangeIndex
Source§fn cmp(&self, other: &NatRangeIndex) -> Ordering
fn cmp(&self, other: &NatRangeIndex) -> 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 PartialEq for NatRangeIndex
impl PartialEq for NatRangeIndex
Source§fn eq(&self, other: &NatRangeIndex) -> bool
fn eq(&self, other: &NatRangeIndex) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NatRangeIndex
impl PartialOrd for NatRangeIndex
impl StructuralPartialEq for NatRangeIndex
Auto Trait Implementations§
impl Freeze for NatRangeIndex
impl RefUnwindSafe for NatRangeIndex
impl Send for NatRangeIndex
impl Sync for NatRangeIndex
impl Unpin for NatRangeIndex
impl UnsafeUnpin for NatRangeIndex
impl UnwindSafe for NatRangeIndex
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.