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