pub unsafe trait Endian: Clone {
// Required methods
fn convert_u16(&self, bytes: [u8; 2]) -> u16;
fn convert_u32(&self, bytes: [u8; 4]) -> u32;
fn convert_u64(&self, bytes: [u8; 8]) -> u64;
// Provided method
fn is_native(&self) -> bool { ... }
}Expand description
Required Methods§
Sourcefn convert_u16(&self, bytes: [u8; 2]) -> u16
fn convert_u16(&self, bytes: [u8; 2]) -> u16
Convert a u16 from the source endian to the native endian.
Sourcefn convert_u32(&self, bytes: [u8; 4]) -> u32
fn convert_u32(&self, bytes: [u8; 4]) -> u32
Convert a u32 from the source endian to the native endian.
Sourcefn convert_u64(&self, bytes: [u8; 8]) -> u64
fn convert_u64(&self, bytes: [u8; 8]) -> u64
Convert a u64 from the source endian to the native endian.
Provided Methods§
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.