pub struct BitDstream { /* private fields */ }
Implementations§
Source§impl BitDstream
impl BitDstream
Sourcepub fn look_bits(&mut self, nb_bits: u8) -> Result<usize>
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
Sourcepub fn skip_bits(&mut self, nb_bits: u8)
pub fn skip_bits(&mut self, nb_bits: u8)
Skip a number of bits by incrementing the bit_consumed
counter.
Sourcepub fn read_bits(&mut self, nb_bits: u8) -> Result<usize>
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.
Sourcepub fn reload_container(&mut self) -> Result<bool>
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 TryFrom<BitEstream> for BitDstream
impl TryFrom<BitEstream> for BitDstream
Source§type Error = BitStreamError
type Error = BitStreamError
The type returned in the event of a conversion error.
Source§fn try_from(stream: BitEstream) -> Result<Self>
fn try_from(stream: BitEstream) -> Result<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for BitDstream
impl RefUnwindSafe for BitDstream
impl Send for BitDstream
impl Sync for BitDstream
impl Unpin for BitDstream
impl UnwindSafe for BitDstream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more