Struct NonMaxU32
pub struct NonMaxU32(/* private fields */);Expand description
A
u32
value that is known not to be
u32::MAX.
This enables some memory layout optimizations. For example,
Option<u32>
is the same size as
u32:
assert_eq!(
core::mem::size_of::<u32>(),
core::mem::size_of::<Option<NonMaxU32>>(),
);Implementations§
Trait Implementations§
§impl Ord for NonMaxU32
impl Ord for NonMaxU32
§impl PartialOrd for NonMaxU32
impl PartialOrd for NonMaxU32
impl Copy for NonMaxU32
impl Eq for NonMaxU32
impl StructuralPartialEq for NonMaxU32
Auto Trait Implementations§
impl Freeze for NonMaxU32
impl RefUnwindSafe for NonMaxU32
impl Send for NonMaxU32
impl Sync for NonMaxU32
impl Unpin for NonMaxU32
impl UnwindSafe for NonMaxU32
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.