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

BitReaderRtl reads bits from least-significant to most-significant from any &[u8].

Stated another way, if N-bits are read from a BitReaderRtl then bit 0, the first bit read, is the least-significant bit, and bit N-1, the last bit read, is the most-significant.

Implementations§

source§

impl<'a> BitReaderRtl<'a>

source

pub fn new(buf: &'a [u8]) -> Self

Instantiate a new BitReaderRtl with the given buffer.

Trait Implementations§

source§

impl<'a> FiniteBitStream for BitReaderRtl<'a>

source§

fn bits_left(&self) -> u64

Gets the number of bits left unread.
source§

impl<'a> ReadBitsRtl for BitReaderRtl<'a>

source§

fn realign(&mut self)

Discards any saved bits and resets the BitStream to prepare it for a byte-aligned read.
source§

fn ignore_bits(&mut self, num_bits: u32) -> Result<()>

Ignores the specified number of bits from the stream or returns an error.
source§

fn ignore_bit(&mut self) -> Result<()>

Ignores one bit from the stream or returns an error.
source§

fn read_bool(&mut self) -> Result<bool>

Read a single bit as a boolean value or returns an error.
source§

fn read_bit(&mut self) -> Result<u32>

Reads and returns a single bit or returns an error.
source§

fn read_bits_leq32(&mut self, bit_width: u32) -> Result<u32>

Reads and returns up to 32-bits or returns an error.
source§

fn read_bits_leq32_signed(&mut self, bit_width: u32) -> Result<i32>

Reads up to 32-bits and interprets them as a signed two’s complement integer or returns an error.
source§

fn read_bits_leq64(&mut self, bit_width: u32) -> Result<u64>

Reads and returns up to 64-bits or returns an error.
source§

fn read_bits_leq64_signed(&mut self, bit_width: u32) -> Result<i64>

Reads up to 64-bits and interprets them as a signed two’s complement integer or returns an error.
source§

fn read_unary_zeros(&mut self) -> Result<u32>

Reads and returns a unary zeros encoded integer or an error.
source§

fn read_unary_zeros_capped(&mut self, limit: u32) -> Result<u32>

Reads and returns a unary zeros encoded integer that is capped to a maximum value.
source§

fn read_unary_ones(&mut self) -> Result<u32>

Reads and returns a unary ones encoded integer or an error.
source§

fn read_unary_ones_capped(&mut self, limit: u32) -> Result<u32>

Reads and returns a unary ones encoded integer or an error.
source§

fn read_codebook<E: CodebookEntry>( &mut self, codebook: &Codebook<E> ) -> Result<(E::ValueType, u32)>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for BitReaderRtl<'a>

§

impl<'a> Send for BitReaderRtl<'a>

§

impl<'a> Sync for BitReaderRtl<'a>

§

impl<'a> Unpin for BitReaderRtl<'a>

§

impl<'a> UnwindSafe for BitReaderRtl<'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> 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<F, T> IntoSample<T> for F
where T: FromSample<F>,

source§

fn into_sample(self) -> T

source§

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

§

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>,

§

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.