Struct BitReadBE

Source
pub struct BitReadBE<'a> { /* private fields */ }
Expand description

A big-endian reader.

It contains the data structures necessary to create a big-endian reader.

Trait Implementations§

Source§

impl<'a> BitRead<'a> for BitReadBE<'a>

Source§

fn new(buffer: &'a [u8]) -> BitReadBE<'a>

Creates a new bitreader with an internal buffer associated to it.
Source§

fn consumed(&self) -> usize

Tells the number of bits read from the internal buffer.
Source§

fn available(&self) -> usize

Tells the number of bits still available in the internal buffer.
Source§

fn skip_bits(&mut self, n: usize)

Discard a certain number of bits from the internal buffer.
Source§

fn get_bit(&mut self) -> bool

Returns a single bit from the internal buffer.
Source§

fn get_bits_64(&mut self, n: usize) -> u64

Returns n bits from the internal buffer as a 64-bit sequence.
Source§

fn get_bits_32(&mut self, n: usize) -> u32

Returns n bits from the internal buffer as a 32-bit sequence.
Source§

fn peek_bit(&mut self) -> bool

Peeks the next bit present in the internal buffer.
Source§

fn peek_bits_32(&mut self, n: usize) -> u32

Peeks the next 32-bit sequence present in the internal buffer.
Source§

fn peek_bits_64(&self, n: usize) -> u64

Peeks the next 64-bit sequence present in the internal buffer.
Source§

fn align_bits(&mut self)

Aligns the bits present in the internal buffer.
Source§

impl<'a> BitReadEndian for BitReadBE<'a>

Source§

fn peek_val(&mut self, n: usize) -> u64

Peeks n bits from the cache.
Source§

fn skip_rem(&mut self, n: usize)

Removes n bits from the cache.
Source§

fn merge_val(msp: u64, lsp: u64, _: usize, lsb: usize) -> u64

Merges two sequences of bits together.
Source§

fn build_cache(cache: u64, refill: u64, cache_size: usize) -> u64

Builds a new cache.
Source§

impl<'a> BitReadFill for BitReadBE<'a>

Source§

fn can_refill(&self) -> bool

Tells if it is still possible to read bits from an internal buffer.
Source§

fn fill32(&self) -> u64

Gets a 32-bits sequence from an internal buffer.
Source§

fn fill64(&self) -> u64

Gets a 64-bits sequence from an internal buffer.
Source§

impl<'a> BitReadInternal for BitReadBE<'a>

Source§

fn left(&self) -> usize

Gets the number of bits left in an internal buffer.
Source§

fn refill32(&mut self)

Extracts a 32-bit sequence from an internal buffer and saves it within an internal cache.
Source§

fn refill64(&mut self)

Extracts a 64-bit sequence from an internal buffer and saves it within an internal cache.
Source§

fn get_val(&mut self, n: usize) -> u64

Returns n bits from an internal buffer.
Source§

impl<'a> Clone for BitReadBE<'a>

Source§

fn clone(&self) -> BitReadBE<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for BitReadBE<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for BitReadBE<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for BitReadBE<'a>

§

impl<'a> RefUnwindSafe for BitReadBE<'a>

§

impl<'a> Send for BitReadBE<'a>

§

impl<'a> Sync for BitReadBE<'a>

§

impl<'a> Unpin for BitReadBE<'a>

§

impl<'a> UnwindSafe for BitReadBE<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'a, S, B> CodebookReader<S> for B
where S: Copy, B: BitRead<'a>,

Source§

fn read_cb(&mut self, cb: &Codebook<S>) -> Result<S, CodebookError>

Reads the codeword from a bitstream and returns its value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.