Trait AsULE
trait AsULE: Copy
A trait for any type that has a 1:1 mapping with an unaligned little-endian (ULE) type.
If you need to implement this trait, consider using #[make_ule] instead.
Associated Types
type ULE: TraitBound { trait_: Path { path: "ULE", id: Id(293), args: None }, generic_params: [], modifier: None }The ULE type corresponding to
Self.Types having infallible conversions from all bit values (Plain Old Data) can use
RawBytesULEwith the desired width; for example,u32usesRawBytesULE<4>.Types that are not well-defined for all bit values should implement a custom ULE.
Required Methods
fn to_unaligned(self: Self) -> <Self as >::ULEConverts from
SelftoSelf::ULE.This function may involve byte order swapping (native-endian to little-endian).
For best performance, mark your implementation of this function
#[inline].fn from_unaligned(unaligned: <Self as >::ULE) -> SelfConverts from
Self::ULEtoSelf.This function may involve byte order swapping (little-endian to native-endian).
For best performance, mark your implementation of this function
#[inline].Safety
This function is infallible because bit validation should have occurred when
Self::ULEwas first constructed. An implementation may therefore involve anunsafe{}block, likefrom_bytes_unchecked().
Implementors
impl AsULE for i128impl AsULE for i32impl AsULE for u128impl AsULE for u32impl<T: AsULE> AsULE for Option<T>impl<A: AsULE, B: AsULE, C: AsULE, D: AsULE, E: AsULE> AsULE for (A, B, C, D, E)impl<A: AsULE, B: AsULE, C: AsULE> AsULE for (A, B, C)impl<T: AsULE, N: usize> AsULE for [T; N]impl AsULE for boolimpl AsULE for f32impl AsULE for i8impl AsULE for u8impl AsULE for i64impl AsULE for i16impl AsULE for u64impl AsULE for u16impl<U: AsULE, N: usize> AsULE for NichedOption<U, N>impl AsULE for charimpl<A: AsULE, B: AsULE, C: AsULE, D: AsULE, E: AsULE, F: AsULE> AsULE for (A, B, C, D, E, F)impl<A: AsULE, B: AsULE, C: AsULE, D: AsULE> AsULE for (A, B, C, D)impl<A: AsULE, B: AsULE> AsULE for (A, B)impl AsULE for ()impl AsULE for f64impl AsULE for NonZeroI8impl AsULE for NonZeroU8