pub struct LittleEndian<T>(/* private fields */);Expand description
Little endian byte order.
Least significant byte first.
Implementations§
Source§impl<T> LittleEndian<T>
impl<T> LittleEndian<T>
pub const unsafe fn from_byte_slice(bytes: &[u8]) -> LittleEndian<T>
pub fn as_byte_slice(&self) -> &[u8]
pub fn as_byte_slice_mut(&mut self) -> &mut [u8]
Source§impl LittleEndian<u16>
impl LittleEndian<u16>
Sourcepub const fn to_bytes(self) -> [u8; 2]
pub const fn to_bytes(self) -> [u8; 2]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 2]) -> LittleEndian<u16>
pub const fn from_bytes(bytes: [u8; 2]) -> LittleEndian<u16>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<u32>
impl LittleEndian<u32>
Sourcepub const fn to_bytes(self) -> [u8; 4]
pub const fn to_bytes(self) -> [u8; 4]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 4]) -> LittleEndian<u32>
pub const fn from_bytes(bytes: [u8; 4]) -> LittleEndian<u32>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<u64>
impl LittleEndian<u64>
Sourcepub const fn to_bytes(self) -> [u8; 8]
pub const fn to_bytes(self) -> [u8; 8]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<u64>
pub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<u64>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<u128>
impl LittleEndian<u128>
Sourcepub const fn to_bytes(self) -> [u8; 16]
pub const fn to_bytes(self) -> [u8; 16]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> LittleEndian<u128>
pub const fn from_bytes(bytes: [u8; 16]) -> LittleEndian<u128>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<usize>
impl LittleEndian<usize>
Sourcepub const fn to_bytes(self) -> [u8; 8]
pub const fn to_bytes(self) -> [u8; 8]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<usize>
pub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<usize>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<i16>
impl LittleEndian<i16>
Sourcepub const fn to_bytes(self) -> [u8; 2]
pub const fn to_bytes(self) -> [u8; 2]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 2]) -> LittleEndian<i16>
pub const fn from_bytes(bytes: [u8; 2]) -> LittleEndian<i16>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<i32>
impl LittleEndian<i32>
Sourcepub const fn to_bytes(self) -> [u8; 4]
pub const fn to_bytes(self) -> [u8; 4]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 4]) -> LittleEndian<i32>
pub const fn from_bytes(bytes: [u8; 4]) -> LittleEndian<i32>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<i64>
impl LittleEndian<i64>
Sourcepub const fn to_bytes(self) -> [u8; 8]
pub const fn to_bytes(self) -> [u8; 8]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<i64>
pub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<i64>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<i128>
impl LittleEndian<i128>
Sourcepub const fn to_bytes(self) -> [u8; 16]
pub const fn to_bytes(self) -> [u8; 16]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> LittleEndian<i128>
pub const fn from_bytes(bytes: [u8; 16]) -> LittleEndian<i128>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Source§impl LittleEndian<isize>
impl LittleEndian<isize>
Sourcepub const fn to_bytes(self) -> [u8; 8]
pub const fn to_bytes(self) -> [u8; 8]
Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.
Sourcepub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<isize>
pub const fn from_bytes(bytes: [u8; 8]) -> LittleEndian<isize>
Construct a value from its memory representation as a byte array. Note: This is just a transmute.
Trait Implementations§
Source§impl<T> BitAnd for LittleEndian<T>where
T: BitAnd,
impl<T> BitAnd for LittleEndian<T>where
T: BitAnd,
Source§impl<T> BitOr for LittleEndian<T>where
T: BitOr,
impl<T> BitOr for LittleEndian<T>where
T: BitOr,
Source§impl<T> BitXor for LittleEndian<T>where
T: BitXor,
impl<T> BitXor for LittleEndian<T>where
T: BitXor,
Source§impl<T: Clone> Clone for LittleEndian<T>
impl<T: Clone> Clone for LittleEndian<T>
Source§fn clone(&self) -> LittleEndian<T>
fn clone(&self) -> LittleEndian<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more