Struct NonMaxU8
pub struct NonMaxU8(/* private fields */);Expand description
A
u8
value that is known not to be
u8::MAX.
This enables some memory layout optimizations. For example,
Option<u8>
is the same size as
u8:
assert_eq!(
core::mem::size_of::<u32>(),
core::mem::size_of::<Option<NonMaxU32>>(),
);Implementations§
Trait Implementations§
§impl Ord for NonMaxU8
impl Ord for NonMaxU8
§impl PartialOrd for NonMaxU8
impl PartialOrd for NonMaxU8
impl Copy for NonMaxU8
impl Eq for NonMaxU8
impl StructuralPartialEq for NonMaxU8
Auto Trait Implementations§
impl Freeze for NonMaxU8
impl RefUnwindSafe for NonMaxU8
impl Send for NonMaxU8
impl Sync for NonMaxU8
impl Unpin for NonMaxU8
impl UnwindSafe for NonMaxU8
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.