Struct bitstream_io::BitQueue [] [src]

pub struct BitQueue<E: Endianness, N: Numeric> { /* fields omitted */ }

A queue for efficiently pushing bits onto a value and popping them off a value.

Methods

impl<E: Endianness, N: Numeric> BitQueue<E, N>
[src]

[src]

Returns a new empty queue

[src]

Creates a new queue from the given value with the given size Panics if the value is larger than the given number of bits.

[src]

Sets the queue to a given value with the given number of bits Panics if the value is larger than the given number of bits

[src]

Consumes the queue and returns its current value

[src]

Returns the total bits in the queue

[src]

Returns the maximum bits the queue can hold

[src]

Returns the remaining bits the queue can hold

[src]

Returns true if the queue is empty

[src]

Returns true if the queue is full

[src]

Drops all values in the queue

[src]

Returns true if all bits remaining in the queue are 0

[src]

Returns true if all bits remaining in the queue are 1

[src]

Pushes a value with the given number of bits onto the tail of the queue Panics if the number of bits pushed is larger than the queue can hold.

[src]

Pops a value with the given number of bits from the head of the queue Panics if the number of bits popped is larger than the number of bits in the queue.

[src]

Drops the given number of bits from the head of the queue without returning them. Panics if the number of bits dropped is larger than the number of bits in the queue.

[src]

Pops all 0 bits up to and including the next 1 bit and returns the amount of 0 bits popped

[src]

Pops all 1 bits up to and including the next 0 bit and returns the amount of 1 bits popped

impl<E: Endianness> BitQueue<E, u8>
[src]

[src]

Returns the state of the queue as a single value which can be used to perform lookups.