pub trait ConstFromBytes: Sized {
type Bytes: Copy + AsRef<[u8]> + AsMut<[u8]>;
// Required methods
fn from_le_bytes(bytes: &Self::Bytes) -> Self;
fn from_be_bytes(bytes: &Self::Bytes) -> Self;
}Expand description
Const-compatible byte deserialization.
Required Associated Types§
Required Methods§
Sourcefn from_le_bytes(bytes: &Self::Bytes) -> Self
fn from_le_bytes(bytes: &Self::Bytes) -> Self
Creates a value from its little-endian byte representation.
Sourcefn from_be_bytes(bytes: &Self::Bytes) -> Self
fn from_be_bytes(bytes: &Self::Bytes) -> Self
Creates a value from its big-endian byte representation.
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.