pub struct NonAnyU8<const NICHE: u8>(/* private fields */);Expand description
An integer that is known not to equal NICHE.
This enables some memory layout optimization.
For example, Option<NonAnyU8<0>> is the same size as u8:
assert_eq!(core::mem::size_of::<Option<nonany::NonAnyU8<0>>>(), core::mem::size_of::<u8>());Implementations§
Trait Implementations§
Source§impl<const NICHE: u8> Ord for NonAnyU8<NICHE>
impl<const NICHE: u8> Ord for NonAnyU8<NICHE>
1.21.0 (const: unstable) · 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 NICHE: u8> PartialEq for NonAnyU8<NICHE>
impl<const NICHE: u8> PartialEq for NonAnyU8<NICHE>
Source§impl<const NICHE: u8> PartialOrd for NonAnyU8<NICHE>
impl<const NICHE: u8> PartialOrd for NonAnyU8<NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: i128> TryFrom<NonAnyI128<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: i128> TryFrom<NonAnyI128<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const TO_NICHE: u8, const FROM_NICHE: i16> TryFrom<NonAnyI16<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: i16> TryFrom<NonAnyI16<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: i32> TryFrom<NonAnyI32<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: i32> TryFrom<NonAnyI32<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: i64> TryFrom<NonAnyI64<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: i64> TryFrom<NonAnyI64<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: i8> TryFrom<NonAnyI8<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: i8> TryFrom<NonAnyI8<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: isize> TryFrom<NonAnyIsize<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: isize> TryFrom<NonAnyIsize<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const TO_NICHE: u8, const FROM_NICHE: u128> TryFrom<NonAnyU128<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: u128> TryFrom<NonAnyU128<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const TO_NICHE: u8, const FROM_NICHE: u16> TryFrom<NonAnyU16<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: u16> TryFrom<NonAnyU16<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: u32> TryFrom<NonAnyU32<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: u32> TryFrom<NonAnyU32<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: u64> TryFrom<NonAnyU64<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: u64> TryFrom<NonAnyU64<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§impl<const TO_NICHE: i128, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI128<TO_NICHE>
impl<const TO_NICHE: i128, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI128<TO_NICHE>
Source§impl<const TO_NICHE: i16, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI16<TO_NICHE>
impl<const TO_NICHE: i16, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI16<TO_NICHE>
Source§impl<const TO_NICHE: i32, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI32<TO_NICHE>
impl<const TO_NICHE: i32, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI32<TO_NICHE>
Source§impl<const TO_NICHE: i64, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI64<TO_NICHE>
impl<const TO_NICHE: i64, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI64<TO_NICHE>
Source§impl<const TO_NICHE: i8, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI8<TO_NICHE>
impl<const TO_NICHE: i8, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyI8<TO_NICHE>
Source§impl<const TO_NICHE: isize, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyIsize<TO_NICHE>
impl<const TO_NICHE: isize, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyIsize<TO_NICHE>
Source§impl<const TO_NICHE: u128, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU128<TO_NICHE>
impl<const TO_NICHE: u128, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU128<TO_NICHE>
Source§impl<const TO_NICHE: u16, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU16<TO_NICHE>
impl<const TO_NICHE: u16, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU16<TO_NICHE>
Source§impl<const TO_NICHE: u32, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU32<TO_NICHE>
impl<const TO_NICHE: u32, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU32<TO_NICHE>
Source§impl<const TO_NICHE: u64, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU64<TO_NICHE>
impl<const TO_NICHE: u64, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyU64<TO_NICHE>
Source§impl<const TO_NICHE: usize, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyUsize<TO_NICHE>
impl<const TO_NICHE: usize, const FROM_NICHE: u8> TryFrom<NonAnyU8<FROM_NICHE>> for NonAnyUsize<TO_NICHE>
Source§impl<const TO_NICHE: u8, const FROM_NICHE: usize> TryFrom<NonAnyUsize<FROM_NICHE>> for NonAnyU8<TO_NICHE>
impl<const TO_NICHE: u8, const FROM_NICHE: usize> TryFrom<NonAnyUsize<FROM_NICHE>> for NonAnyU8<TO_NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<i128>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<i128>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<i16>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<i16>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<i32>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<i32>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<i64>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<i64>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<isize>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<isize>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<u128>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<u128>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<u16>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<u16>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<u32>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<u32>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<u64>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<u64>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
Source§impl<const NICHE: u8> TryFrom<NonZero<usize>> for NonAnyU8<NICHE>
impl<const NICHE: u8> TryFrom<NonZero<usize>> for NonAnyU8<NICHE>
Source§type Error = CheckedError
type Error = CheckedError
The type returned in the event of a conversion error.
impl<const NICHE: u8> Copy for NonAnyU8<NICHE>
impl<const NICHE: u8> Eq for NonAnyU8<NICHE>
impl<const NICHE: u8> StructuralPartialEq for NonAnyU8<NICHE>
Auto Trait Implementations§
impl<const NICHE: u8> Freeze for NonAnyU8<NICHE>
impl<const NICHE: u8> RefUnwindSafe for NonAnyU8<NICHE>
impl<const NICHE: u8> Send for NonAnyU8<NICHE>
impl<const NICHE: u8> Sync for NonAnyU8<NICHE>
impl<const NICHE: u8> Unpin for NonAnyU8<NICHE>
impl<const NICHE: u8> UnsafeUnpin for NonAnyU8<NICHE>
impl<const NICHE: u8> UnwindSafe for NonAnyU8<NICHE>
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