Trait ByteOrder

Source
pub trait ByteOrder {
    // Required methods
    fn load<O, U>(src: &BitSlice<O, Msb0>) -> U
       where O: BitStore,
             U: Integral;
    fn load_u16(src: &[u8]) -> u16;
    fn load_u24(src: &[u8]) -> u24;
    fn load_u32(src: &[u8]) -> u32;
    fn store<O, U>(dest: &mut BitSlice<O, Msb0>, value: U)
       where O: BitStore,
             U: Integral;
    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, U>(src: &BitSlice<O, Msb0>) -> U
where O: BitStore, U: Integral,

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, U>(dest: &mut BitSlice<O, Msb0>, value: U)
where O: BitStore, U: Integral,

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§