Trait bitstream_io::BitQueue [] [src]

pub trait BitQueue<N: Numeric> {
    fn set(&mut self, value: N, bits: u32);
    fn value(self) -> N;
    fn len(&self) -> u32;
    fn push(&mut self, bits: u32, value: N);
    fn pop(&mut self, bits: u32) -> N;

    fn is_empty(&self) -> bool { ... }
    fn clear(&mut self) { ... }
}

This trait is for treating numeric types as a queue of bits which values can be pushed to and popped from in order to implement bitstream readers and writers.

Required Methods

Discards queue's current status and sets it to new bits and value

Consumes queue and returns its internal value

Current length of queue, in bits

Pushes a new value onto the back of the queue using the given number of bits. May panic if the total number of bits exceeds the size of the type being pushed onto.

Pops a value from the front of the queue with the given number of bits. Returns queue's whole contents if the requested number of bits exceeds the size of the queue.

Provided Methods

Whether or not the queue is empty

Discards queue's current status and sets bits and value to 0

Implementors