Struct const_identify::OrderedIdArray
source · pub struct OrderedIdArray<const SIZE: usize> { /* private fields */ }Expand description
An array of ConstId structs that is guaranteed to be in sorted order.
Implementations§
source§impl<const SIZE: usize> OrderedIdArray<SIZE>
impl<const SIZE: usize> OrderedIdArray<SIZE>
sourcepub const fn new(ids: [ConstId; SIZE]) -> Self
pub const fn new(ids: [ConstId; SIZE]) -> Self
Returns a new ordered array containing the sorted version of ids.
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) -> OrderedIdSlice<'_>
pub const fn as_slice(&self) -> OrderedIdSlice<'_>
Returns an OrderedIdSlice 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_unique(self) -> Result<UniqueIdArray<SIZE>, Self>
pub const fn into_unique(self) -> Result<UniqueIdArray<SIZE>, Self>
Consumes self and returns a UniqueIdArray.
Returns Err(Self) if the items in this array contains duplicates
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 OrderedIdArray<SIZE>
impl<const SIZE: usize> Clone for OrderedIdArray<SIZE>
source§fn clone(&self) -> OrderedIdArray<SIZE>
fn clone(&self) -> OrderedIdArray<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 OrderedIdArray<SIZE>
impl<const SIZE: usize> Debug for OrderedIdArray<SIZE>
source§impl<const SIZE: usize> Hash for OrderedIdArray<SIZE>
impl<const SIZE: usize> Hash for OrderedIdArray<SIZE>
source§impl<const SIZE: usize> Ord for OrderedIdArray<SIZE>
impl<const SIZE: usize> Ord for OrderedIdArray<SIZE>
source§fn cmp(&self, other: &OrderedIdArray<SIZE>) -> Ordering
fn cmp(&self, other: &OrderedIdArray<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 OrderedIdArray<SIZE>
impl<const SIZE: usize> PartialEq for OrderedIdArray<SIZE>
source§fn eq(&self, other: &OrderedIdArray<SIZE>) -> bool
fn eq(&self, other: &OrderedIdArray<SIZE>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<const SIZE: usize> PartialOrd for OrderedIdArray<SIZE>
impl<const SIZE: usize> PartialOrd for OrderedIdArray<SIZE>
source§fn partial_cmp(&self, other: &OrderedIdArray<SIZE>) -> Option<Ordering>
fn partial_cmp(&self, other: &OrderedIdArray<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 OrderedIdArray<SIZE>
impl<const SIZE: usize> Eq for OrderedIdArray<SIZE>
impl<const SIZE: usize> StructuralEq for OrderedIdArray<SIZE>
impl<const SIZE: usize> StructuralPartialEq for OrderedIdArray<SIZE>
Auto Trait Implementations§
impl<const SIZE: usize> RefUnwindSafe for OrderedIdArray<SIZE>
impl<const SIZE: usize> Send for OrderedIdArray<SIZE>
impl<const SIZE: usize> Sync for OrderedIdArray<SIZE>
impl<const SIZE: usize> Unpin for OrderedIdArray<SIZE>
impl<const SIZE: usize> UnwindSafe for OrderedIdArray<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