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