Trait bitstream_io::Endianness
[−]
[src]
pub trait Endianness {
fn push<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32, value: N)
where
N: Numeric;
fn pop<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32) -> N
where
N: Numeric;
fn drop<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32)
where
N: Numeric;
fn next_zeros<N>(bits: u32, value: N) -> u32
where
N: Numeric;
fn next_ones<N>(bits: u32, value: N) -> u32
where
N: Numeric;
}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
fn push<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32, value: N) where
N: Numeric,
N: Numeric,
Pushes the given bits and value onto an accumulator with the given bits and value.
fn pop<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32) -> N where
N: Numeric,
N: Numeric,
Pops a value with the given number of bits from an accumulator with the given bits and value.
fn drop<N>(bits_acc: &mut u32, value_acc: &mut N, bits: u32) where
N: Numeric,
N: Numeric,
Drops the given number of bits from an accumulator with the given bits and value.
fn next_zeros<N>(bits: u32, value: N) -> u32 where
N: Numeric,
N: Numeric,
Returns the next number of 0 bits from an accumulator with the given bits and value.
fn next_ones<N>(bits: u32, value: N) -> u32 where
N: Numeric,
N: Numeric,
Returns the next number of 1 bits from an accumulator with the given bits and value.
Implementors
impl Endianness for BigEndianimpl Endianness for LittleEndian