Trait ByteOrder

Source
pub trait ByteOrder {
    // Required methods
    fn load<O: BitStore, U: Integral>(src: &BitSlice<O>) -> U;
    fn load_u16(src: &[u8]) -> u16;
    fn load_u24(src: &[u8]) -> u24;
    fn load_u32(src: &[u8]) -> u32;
    fn store<O: BitStore, U: Integral>(dest: &mut BitSlice<O>, value: U);
    fn store_u16(dest: &mut [u8], value: u16);
    fn store_u24(dest: &mut [u8], value: u24);
    fn store_u32(dest: &mut [u8], value: u32);
}
Expand description

This trait defines operations to load and store integral values from a buffer, and enables implementing them in different ways for the different byte orders (Big Endian and Little Endian).

Required Methods§

Source

fn load<O: BitStore, U: Integral>(src: &BitSlice<O>) -> U

Source

fn load_u16(src: &[u8]) -> u16

Source

fn load_u24(src: &[u8]) -> u24

Source

fn load_u32(src: &[u8]) -> u32

Source

fn store<O: BitStore, U: Integral>(dest: &mut BitSlice<O>, value: U)

Source

fn store_u16(dest: &mut [u8], value: u16)

Source

fn store_u24(dest: &mut [u8], value: u24)

Source

fn store_u32(dest: &mut [u8], value: u32)

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.

Implementors§