pub struct LittleEndian<T: Endianable>(/* private fields */);Expand description
A wrapper type that ensures the inner Endianable value is treated as Little-Endian.
When creating a LittleEndian instance, the value is converted to little-endian.
When retrieving the inner value with get, it is converted back
to the native endianness.
Implementations§
Source§impl<T: Endianable> LittleEndian<T>
impl<T: Endianable> LittleEndian<T>
Trait Implementations§
Source§impl<T: Endianable> Byteable for LittleEndian<T>
impl<T: Endianable> Byteable for LittleEndian<T>
Source§type ByteArray = <T as Endianable>::ByteArray
type ByteArray = <T as Endianable>::ByteArray
The associated byte array type that can represent
Self.Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.const BINARY_SIZE: usize = <Self::ByteArray>::BINARY_SIZE
Source§impl<T: Clone + Endianable> Clone for LittleEndian<T>
impl<T: Clone + Endianable> Clone for LittleEndian<T>
Source§fn clone(&self) -> LittleEndian<T>
fn clone(&self) -> LittleEndian<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Endianable> Debug for LittleEndian<T>
impl<T: Debug + Endianable> Debug for LittleEndian<T>
Source§impl<T: Endianable + Default> Default for LittleEndian<T>
impl<T: Endianable + Default> Default for LittleEndian<T>
Source§impl<T: Hash + Endianable> Hash for LittleEndian<T>
impl<T: Hash + Endianable> Hash for LittleEndian<T>
Source§impl<T: Ord + Endianable> Ord for LittleEndian<T>
impl<T: Ord + Endianable> Ord for LittleEndian<T>
Source§impl<T: PartialEq + Endianable> PartialEq for LittleEndian<T>
impl<T: PartialEq + Endianable> PartialEq for LittleEndian<T>
Source§impl<T: PartialOrd + Endianable> PartialOrd for LittleEndian<T>
impl<T: PartialOrd + Endianable> PartialOrd for LittleEndian<T>
impl<T: Copy + Endianable> Copy for LittleEndian<T>
impl<T: Eq + Endianable> Eq for LittleEndian<T>
Auto Trait Implementations§
impl<T> Freeze for LittleEndian<T>
impl<T> RefUnwindSafe for LittleEndian<T>
impl<T> Send for LittleEndian<T>
impl<T> Sync for LittleEndian<T>
impl<T> Unpin for LittleEndian<T>
impl<T> UnwindSafe for LittleEndian<T>
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<Raw, Regular> ByteableRaw<Regular> for Rawwhere
Regular: ByteableRegular<Raw = Raw>,
Raw: Byteable,
impl<Raw, Regular> ByteableRaw<Regular> for Rawwhere
Regular: ByteableRegular<Raw = Raw>,
Raw: Byteable,
Source§fn to_regular(self) -> Regular
fn to_regular(self) -> Regular
Converts the raw representation to the regular form.
Source§fn from_regular(regular: Regular) -> Raw
fn from_regular(regular: Regular) -> Raw
Converts the regular form to the raw representation.