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 duplicate 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§impl<const SIZE: usize> PartialOrd for OrderedIdArray<SIZE>
impl<const SIZE: usize> PartialOrd for OrderedIdArray<SIZE>
impl<const SIZE: usize> Copy for OrderedIdArray<SIZE>
impl<const SIZE: usize> Eq for OrderedIdArray<SIZE>
impl<const SIZE: usize> StructuralPartialEq for OrderedIdArray<SIZE>
Auto Trait Implementations§
impl<const SIZE: usize> Freeze for OrderedIdArray<SIZE>
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