Struct BitDstream

Source
pub struct BitDstream { /* private fields */ }

Implementations§

Source§

impl BitDstream

Source

pub fn look_bits(&mut self, nb_bits: u8) -> Result<usize>

Look a nb_bits in the container

The container isn’t modified Return an error if nb_bits overflow container

Source

pub fn skip_bits(&mut self, nb_bits: u8)

Skip a number of bits by incrementing the bit_consumed counter.

Source

pub fn read_bits(&mut self, nb_bits: u8) -> Result<usize>

Read and consumed in the local bits_container You’ve to be carefull and not read more than CTNR_SIZE

Whatever it return an error if you overflow the bitcontainer. That’s the signal for reloading.

Source

pub fn reload_container(&mut self) -> Result<bool>

Once you’ve read CTNR_SIZE bits, you probably would like to refill it and continue to read the stream vector.

Trait Implementations§

Source§

impl BitReader<usize> for BitDstream

Source§

fn read(&mut self, nb_bits: u8) -> Result<usize>

Source§

impl TryFrom<BitEstream> for BitDstream

Source§

type Error = BitStreamError

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

fn try_from(stream: BitEstream) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<Vec<u8>> for BitDstream

Source§

type Error = BitStreamError

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

fn try_from(stream: Vec<u8>) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

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