pub trait Integer<const BYTES: usize> {
// Required methods
fn from_be_bytes(bytes: [u8; BYTES]) -> Self;
fn from_le_bytes(bytes: [u8; BYTES]) -> Self;
fn from_ne_bytes(bytes: [u8; BYTES]) -> Self;
}
Expand description
Common functions for integers.
Required Methods§
Sourcefn from_be_bytes(bytes: [u8; BYTES]) -> Self
fn from_be_bytes(bytes: [u8; BYTES]) -> Self
Creates a native endian integer value from its representation as a byte array in big endian.
Sourcefn from_le_bytes(bytes: [u8; BYTES]) -> Self
fn from_le_bytes(bytes: [u8; BYTES]) -> Self
Creates a native endian integer value from its representation as a byte array in little endian.
Sourcefn from_ne_bytes(bytes: [u8; BYTES]) -> Self
fn from_ne_bytes(bytes: [u8; BYTES]) -> Self
Creates a native endian integer value from its representation as a byte array in native endian.
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.