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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Copy> Copy for LittleEndian<T>
Source§impl<T: Debug> Debug for LittleEndian<T>
impl<T: Debug> Debug for LittleEndian<T>
impl<T> Endian<T> for LittleEndian<T>
impl<T: Eq> Eq for LittleEndian<T>
Source§impl From<LittleEndian<i16>> for BigEndian<i16>
impl From<LittleEndian<i16>> for BigEndian<i16>
Source§fn from(data: LittleEndian<i16>) -> Self
fn from(data: LittleEndian<i16>) -> Self
Source§impl From<LittleEndian<i32>> for BigEndian<i32>
impl From<LittleEndian<i32>> for BigEndian<i32>
Source§fn from(data: LittleEndian<i32>) -> Self
fn from(data: LittleEndian<i32>) -> Self
Source§impl From<LittleEndian<i64>> for BigEndian<i64>
impl From<LittleEndian<i64>> for BigEndian<i64>
Source§fn from(data: LittleEndian<i64>) -> Self
fn from(data: LittleEndian<i64>) -> Self
Source§impl From<LittleEndian<i128>> for BigEndian<i128>
impl From<LittleEndian<i128>> for BigEndian<i128>
Source§fn from(data: LittleEndian<i128>) -> Self
fn from(data: LittleEndian<i128>) -> Self
Source§impl From<LittleEndian<isize>> for BigEndian<isize>
impl From<LittleEndian<isize>> for BigEndian<isize>
Source§fn from(data: LittleEndian<isize>) -> Self
fn from(data: LittleEndian<isize>) -> Self
Source§impl From<LittleEndian<u16>> for BigEndian<u16>
impl From<LittleEndian<u16>> for BigEndian<u16>
Source§fn from(data: LittleEndian<u16>) -> Self
fn from(data: LittleEndian<u16>) -> Self
Source§impl From<LittleEndian<u32>> for BigEndian<u32>
impl From<LittleEndian<u32>> for BigEndian<u32>
Source§fn from(data: LittleEndian<u32>) -> Self
fn from(data: LittleEndian<u32>) -> Self
Source§impl From<LittleEndian<u64>> for BigEndian<u64>
impl From<LittleEndian<u64>> for BigEndian<u64>
Source§fn from(data: LittleEndian<u64>) -> Self
fn from(data: LittleEndian<u64>) -> Self
Source§impl From<LittleEndian<u128>> for BigEndian<u128>
impl From<LittleEndian<u128>> for BigEndian<u128>
Source§fn from(data: LittleEndian<u128>) -> Self
fn from(data: LittleEndian<u128>) -> Self
Source§impl From<LittleEndian<usize>> for BigEndian<usize>
impl From<LittleEndian<usize>> for BigEndian<usize>
Source§fn from(data: LittleEndian<usize>) -> Self
fn from(data: LittleEndian<usize>) -> Self
Source§impl<T: Hash> Hash for LittleEndian<T>
impl<T: Hash> Hash for LittleEndian<T>
Source§impl<T: Ord> Ord for LittleEndian<T>
impl<T: Ord> Ord for LittleEndian<T>
Source§fn cmp(&self, other: &LittleEndian<T>) -> Ordering
fn cmp(&self, other: &LittleEndian<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialEq> PartialEq for LittleEndian<T>
impl<T: PartialEq> PartialEq for LittleEndian<T>
Source§fn eq(&self, other: &LittleEndian<T>) -> bool
fn eq(&self, other: &LittleEndian<T>) -> bool
self and other values to be equal, and is used by ==.