pub struct Le<T>(pub T);Expand description
Little-endian wrapper: encodes and decodes T least significant byte
first.
§Example
use wire_codec::{Decode, Encode, Le, ReadBuf, WriteBuf};
let mut out = [0u8; 4];
let mut buf = WriteBuf::new(&mut out);
Le(1.0_f32).encode(&mut buf).unwrap();
assert_eq!(out, [0x00, 0x00, 0x80, 0x3F]);
assert_eq!(Le::<f32>::decode(&mut ReadBuf::new(&out)).unwrap(), Le(1.0));Tuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for Le<T>
impl<T: Eq> Eq for Le<T>
Source§impl<T: Ord> Ord for Le<T>
impl<T: Ord> Ord for Le<T>
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for Le<T>
impl<T: PartialOrd> PartialOrd for Le<T>
impl<T: PartialEq> StructuralPartialEq for Le<T>
Auto Trait Implementations§
impl<T> Freeze for Le<T>where
T: Freeze,
impl<T> RefUnwindSafe for Le<T>where
T: RefUnwindSafe,
impl<T> Send for Le<T>where
T: Send,
impl<T> Sync for Le<T>where
T: Sync,
impl<T> Unpin for Le<T>where
T: Unpin,
impl<T> UnsafeUnpin for Le<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Le<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