Struct const_identify::UniqueIdArray
source · pub struct UniqueIdArray<const SIZE: usize> { /* private fields */ }Expand description
An array of ConstId structs that are guaranteed to be unique and in sorted order.
Implementations§
source§impl<const SIZE: usize> UniqueIdArray<SIZE>
impl<const SIZE: usize> UniqueIdArray<SIZE>
sourcepub const fn new(ids: [ConstId; SIZE]) -> Option<Self>
pub const fn new(ids: [ConstId; SIZE]) -> Option<Self>
Returns a new unique and sorted array containing the sorted version of ids.
Returns None if the ids contains duplicates.
sourcepub const fn as_raw_slice(&self) -> &[ConstId]
pub const fn as_raw_slice(&self) -> &[ConstId]
Returns the underlying id slice.
sourcepub const fn as_slice(&self) -> UniqueIdSlice<'_>
pub const fn as_slice(&self) -> UniqueIdSlice<'_>
Returns a UniqueIdSlice with this arrays content.
sourcepub const fn into_raw(&self) -> [ConstId; SIZE]
pub const fn into_raw(&self) -> [ConstId; SIZE]
Consumes self and returns the underlying id array
sourcepub const fn into_ordered(&self) -> OrderedIdArray<SIZE>
pub const fn into_ordered(&self) -> OrderedIdArray<SIZE>
Consumes self and returns an OrderedIdArray.
sourcepub const fn const_cmp_ordered<const SIZE2: usize>(
&self,
other: &OrderedIdArray<SIZE2>
) -> Ordering
pub const fn const_cmp_ordered<const SIZE2: usize>( &self, other: &OrderedIdArray<SIZE2> ) -> Ordering
Returns the ordering between self and other
sourcepub const fn const_cmp_ordered_slice(
&self,
other: &OrderedIdSlice<'_>
) -> Ordering
pub const fn const_cmp_ordered_slice( &self, other: &OrderedIdSlice<'_> ) -> Ordering
Returns the ordering between self and other
sourcepub const fn const_cmp_unique<const SIZE2: usize>(
&self,
other: &UniqueIdArray<SIZE2>
) -> Ordering
pub const fn const_cmp_unique<const SIZE2: usize>( &self, other: &UniqueIdArray<SIZE2> ) -> Ordering
Returns the ordering between self and other
sourcepub const fn const_cmp_unique_slice(
&self,
other: &UniqueIdSlice<'_>
) -> Ordering
pub const fn const_cmp_unique_slice( &self, other: &UniqueIdSlice<'_> ) -> Ordering
Returns the ordering between self and other
Trait Implementations§
source§impl<const SIZE: usize> Clone for UniqueIdArray<SIZE>
impl<const SIZE: usize> Clone for UniqueIdArray<SIZE>
source§fn clone(&self) -> UniqueIdArray<SIZE>
fn clone(&self) -> UniqueIdArray<SIZE>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<const SIZE: usize> Debug for UniqueIdArray<SIZE>
impl<const SIZE: usize> Debug for UniqueIdArray<SIZE>
source§impl<const SIZE: usize> Hash for UniqueIdArray<SIZE>
impl<const SIZE: usize> Hash for UniqueIdArray<SIZE>
source§impl<const SIZE: usize> Ord for UniqueIdArray<SIZE>
impl<const SIZE: usize> Ord for UniqueIdArray<SIZE>
source§fn cmp(&self, other: &UniqueIdArray<SIZE>) -> Ordering
fn cmp(&self, other: &UniqueIdArray<SIZE>) -> Ordering
1.21.0 · 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<const SIZE: usize> PartialEq for UniqueIdArray<SIZE>
impl<const SIZE: usize> PartialEq for UniqueIdArray<SIZE>
source§fn eq(&self, other: &UniqueIdArray<SIZE>) -> bool
fn eq(&self, other: &UniqueIdArray<SIZE>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<const SIZE: usize> PartialOrd for UniqueIdArray<SIZE>
impl<const SIZE: usize> PartialOrd for UniqueIdArray<SIZE>
source§fn partial_cmp(&self, other: &UniqueIdArray<SIZE>) -> Option<Ordering>
fn partial_cmp(&self, other: &UniqueIdArray<SIZE>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<const SIZE: usize> Copy for UniqueIdArray<SIZE>
impl<const SIZE: usize> Eq for UniqueIdArray<SIZE>
impl<const SIZE: usize> StructuralEq for UniqueIdArray<SIZE>
impl<const SIZE: usize> StructuralPartialEq for UniqueIdArray<SIZE>
Auto Trait Implementations§
impl<const SIZE: usize> RefUnwindSafe for UniqueIdArray<SIZE>
impl<const SIZE: usize> Send for UniqueIdArray<SIZE>
impl<const SIZE: usize> Sync for UniqueIdArray<SIZE>
impl<const SIZE: usize> Unpin for UniqueIdArray<SIZE>
impl<const SIZE: usize> UnwindSafe for UniqueIdArray<SIZE>
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