pub trait Endianness: Sized {
    // Required methods
    fn push<N>(queue: &mut BitQueue<Self, N>, bits: u32, value: N)
       where N: Numeric;
    fn pop<N>(queue: &mut BitQueue<Self, N>, bits: u32) -> N
       where N: Numeric;
    fn drop<N>(queue: &mut BitQueue<Self, N>, bits: u32)
       where N: Numeric;
    fn next_zeros<N>(queue: &BitQueue<Self, N>) -> u32
       where N: Numeric;
    fn next_ones<N>(queue: &BitQueue<Self, N>) -> u32
       where N: Numeric;
    fn read_signed<R, S>(r: &mut R, bits: u32) -> Result<S>
       where R: BitRead,
             S: SignedNumeric;
    fn write_signed<W, S>(w: &mut W, bits: u32, value: S) -> Result<()>
       where W: BitWrite,
             S: SignedNumeric;
    fn read_primitive<R, V>(r: &mut R) -> Result<V>
       where R: BitRead,
             V: Primitive;
    fn write_primitive<W, V>(w: &mut W, value: V) -> Result<()>
       where W: BitWrite,
             V: Primitive;
    fn read_numeric<R, V>(r: R) -> Result<V>
       where R: Read,
             V: Primitive;
    fn write_numeric<W, V>(w: W, value: V) -> Result<()>
       where W: Write,
             V: Primitive;
}
Expand description

A stream’s endianness, or byte order, for determining how bits should be read.

It comes in BigEndian and LittleEndian varieties (which may be shortened to BE and LE) and is not something programmers should have to implement in most cases.

Required Methods§

source

fn push<N>(queue: &mut BitQueue<Self, N>, bits: u32, value: N)
where N: Numeric,

Pushes the given bits and value onto an accumulator with the given bits and value.

source

fn pop<N>(queue: &mut BitQueue<Self, N>, bits: u32) -> N
where N: Numeric,

Pops a value with the given number of bits from an accumulator with the given bits and value.

source

fn drop<N>(queue: &mut BitQueue<Self, N>, bits: u32)
where N: Numeric,

Drops the given number of bits from an accumulator with the given bits and value.

source

fn next_zeros<N>(queue: &BitQueue<Self, N>) -> u32
where N: Numeric,

Returns the next number of 0 bits from an accumulator with the given bits and value.

source

fn next_ones<N>(queue: &BitQueue<Self, N>) -> u32
where N: Numeric,

Returns the next number of 1 bits from an accumulator with the given bits and value.

source

fn read_signed<R, S>(r: &mut R, bits: u32) -> Result<S>
where R: BitRead, S: SignedNumeric,

Reads signed value from reader in this endianness

source

fn write_signed<W, S>(w: &mut W, bits: u32, value: S) -> Result<()>
where W: BitWrite, S: SignedNumeric,

Writes signed value to writer in this endianness

source

fn read_primitive<R, V>(r: &mut R) -> Result<V>
where R: BitRead, V: Primitive,

Reads convertable numeric value from reader in this endianness

source

fn write_primitive<W, V>(w: &mut W, value: V) -> Result<()>
where W: BitWrite, V: Primitive,

Writes convertable numeric value to writer in this endianness

source

fn read_numeric<R, V>(r: R) -> Result<V>
where R: Read, V: Primitive,

Reads entire numeric value from reader in this endianness

source

fn write_numeric<W, V>(w: W, value: V) -> Result<()>
where W: Write, V: Primitive,

Writes entire numeric value to writer in this endianness

Object Safety§

This trait is not object safe.

Implementors§