Union NichedOptionULE
union NichedOptionULE<U: NicheBytes<N> + ULE, N: usize> { ... }
ULE type for [NichedOption<U,N>] where U implements NicheBytes.
The invalid bit pattern is used as the niche.
This uses 1 byte less than [crate::ule::OptionULE<U>] to represent [NichedOption<U,N>].
Example
use NonZeroI8;
use NichedOption;
use ZeroVec;
let bytes = &;
let zv_no: =
parse_bytes.expect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Implementations
impl<U: NicheBytes<N> + ULE, N: usize> NichedOptionULE<U, N>
fn new(opt: Option<U>) -> SelfNew
NichedOptionULE<U, N>fromOption<U>fn get(self: Self) -> Option<U>Convert to an
Option<U>fn as_ref(self: &Self) -> Option<&U>Borrows as an
Option<&U>.
impl<T> Any for NichedOptionULE<U, N>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for NichedOptionULE<U, N>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for NichedOptionULE<U, N>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for NichedOptionULE<U, N>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for NichedOptionULE<U, N>
impl<T> From for NichedOptionULE<U, N>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for NichedOptionULE<U, N>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for NichedOptionULE<U, N>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for NichedOptionULE<U, N>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for NichedOptionULE<U, N>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<U, N: usize> Freeze for NichedOptionULE<U, N>
impl<U, N: usize> RefUnwindSafe for NichedOptionULE<U, N>
impl<U, N: usize> Send for NichedOptionULE<U, N>
impl<U, N: usize> Sync for NichedOptionULE<U, N>
impl<U, N: usize> Unpin for NichedOptionULE<U, N>
impl<U, N: usize> UnsafeUnpin for NichedOptionULE<U, N>
impl<U, N: usize> UnwindSafe for NichedOptionULE<U, N>
impl<U: NicheBytes<N> + ULE + Eq, N: usize> Eq for NichedOptionULE<U, N>
impl<U: NicheBytes<N> + ULE + PartialEq, N: usize> PartialEq for NichedOptionULE<U, N>
fn eq(self: &Self, other: &Self) -> bool
impl<U: NicheBytes<N> + ULE + core::fmt::Debug, N: usize> Debug for NichedOptionULE<U, N>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<U: NicheBytes<N> + ULE, N: usize> Clone for NichedOptionULE<U, N>
fn clone(self: &Self) -> Self
impl<U: NicheBytes<N> + ULE, N: usize> Copy for NichedOptionULE<U, N>
impl<U: NicheBytes<N> + ULE, N: usize> ULE for NichedOptionULE<U, N>
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>