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 into_inner, it is converted back
to the native endianness.
Implementations§
Source§impl<T: Endianable> LittleEndian<T>
impl<T: Endianable> LittleEndian<T>
Sourcepub fn new(val: T) -> Self
pub fn new(val: T) -> Self
Creates a new LittleEndian instance from a value, converting it to little-endian.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the LittleEndian wrapper and returns the inner value,
converting it from little-endian to the native endianness.
Trait Implementations§
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§fn cmp(&self, other: &LittleEndian<T>) -> Ordering
fn cmp(&self, other: &LittleEndian<T>) -> Ordering
1.21.0 · 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<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>
impl<T: Endianable> StructuralPartialEq for LittleEndian<T>
Auto Trait Implementations§
impl<T> Freeze for LittleEndian<T>where
T: Freeze,
impl<T> RefUnwindSafe for LittleEndian<T>where
T: RefUnwindSafe,
impl<T> Send for LittleEndian<T>where
T: Send,
impl<T> Sync for LittleEndian<T>where
T: Sync,
impl<T> Unpin for LittleEndian<T>where
T: Unpin,
impl<T> UnwindSafe for LittleEndian<T>where
T: UnwindSafe,
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