pub trait ByteOrder {
// Required methods
fn read_u32(buf: &[u8]) -> u32;
fn write_u32(buf: &mut [u8], n: u32);
fn write_u64(buf: &mut [u8], n: u64);
}Expand description
Reads and writes numbers in a specific byte order.
Required Methods§
Sourcefn read_u32(buf: &[u8]) -> u32
fn read_u32(buf: &[u8]) -> u32
Reads an unsigned 32-bit integer from the first four bytes of buf.
§Panics
Panics when buf.len() < 4.
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.