pub trait LittleEndianBytes<const N: usize> {
// Required methods
fn from_le_bytes(bytes: [u8; N]) -> Self;
fn to_le_bytes(self) -> [u8; N];
}
Expand description
Convert from and to the little endian byte representation of a value
N
denotes the number of bytes required for the little endian representation
Required Methods§
Sourcefn from_le_bytes(bytes: [u8; N]) -> Self
fn from_le_bytes(bytes: [u8; N]) -> Self
Convert from a byte array to Self
Sourcefn to_le_bytes(self) -> [u8; N]
fn to_le_bytes(self) -> [u8; N]
Convert from self to a byte array
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.