pub struct BaseIndex32 { /* private fields */ }Expand description
A specialized wrapper around a primitive number.
Implementations§
Source§impl BaseIndex32
impl BaseIndex32
Sourcepub const MAX_AS: u32 = 4_294_967_040u32
pub const MAX_AS: u32 = 4_294_967_040u32
The maximum index value, as the underlying primitive type.
Sourcepub const fn try_new(value: u32) -> Option<Self>
pub const fn try_new(value: u32) -> Option<Self>
Creates a new BaseIndex32 from the given value.
Returns None if value exceeds MAX.
Sourcepub const fn from_usize(value: usize) -> Self
pub const fn from_usize(value: usize) -> Self
Sourcepub const fn try_from_usize(value: usize) -> Option<Self>
pub const fn try_from_usize(value: usize) -> Option<Self>
Creates a new BaseIndex32 from the given value.
Returns None if value exceeds MAX.
Sourcepub const unsafe fn new_unchecked(value: u32) -> Self
pub const unsafe fn new_unchecked(value: u32) -> Self
Creates a new BaseIndex32 from the given value, without checking for overflow.
§Safety
The caller must ensure that value is less than or equal to MAX.
Sourcepub const unsafe fn from_usize_unchecked(value: usize) -> Self
pub const unsafe fn from_usize_unchecked(value: usize) -> Self
Creates a new BaseIndex32 from the given value, without checking for overflow.
§Safety
The caller must ensure that value is less than or equal to MAX.
Trait Implementations§
Source§impl Clone for BaseIndex32
impl Clone for BaseIndex32
Source§fn clone(&self) -> BaseIndex32
fn clone(&self) -> BaseIndex32
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BaseIndex32
impl Debug for BaseIndex32
Source§impl Hash for BaseIndex32
impl Hash for BaseIndex32
Source§impl Idx for BaseIndex32
impl Idx for BaseIndex32
Source§impl Ord for BaseIndex32
impl Ord for BaseIndex32
Source§fn cmp(&self, other: &BaseIndex32) -> Ordering
fn cmp(&self, other: &BaseIndex32) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BaseIndex32
impl PartialEq for BaseIndex32
Source§impl PartialOrd for BaseIndex32
impl PartialOrd for BaseIndex32
impl Copy for BaseIndex32
impl Eq for BaseIndex32
impl StructuralPartialEq for BaseIndex32
Auto Trait Implementations§
impl Freeze for BaseIndex32
impl RefUnwindSafe for BaseIndex32
impl Send for BaseIndex32
impl Sync for BaseIndex32
impl Unpin for BaseIndex32
impl UnwindSafe for BaseIndex32
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
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
key and return true if they are equal.Source§impl<I, T> IdxSliceIndex<I, T> for Iwhere
I: Idx,
impl<I, T> IdxSliceIndex<I, T> for Iwhere
I: Idx,
type Output = T
fn get( self, slice: &IndexSlice<I, [T]>, ) -> Option<&<I as IdxSliceIndex<I, T>>::Output>
fn get_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> Option<&mut <I as IdxSliceIndex<I, T>>::Output>
fn index( self, slice: &IndexSlice<I, [T]>, ) -> &<I as IdxSliceIndex<I, T>>::Output
fn index_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> &mut <I as IdxSliceIndex<I, T>>::Output
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes