Struct dsi_bitstream::utils::CountBitReader
source · pub struct CountBitReader<E: Endianness, BR: BitRead<E>, const PRINT: bool = false> {
pub bits_read: usize,
/* private fields */
}
Expand description
A wrapper around a BitRead
that keeps track of the number of
bits read and optionally prints on standard error the operations performed on the stream.
Fields§
§bits_read: usize
The number of bits read (or skipped) so far from the underlying BitRead
.
Implementations§
source§impl<E: Endianness, BR: BitRead<E>, const PRINT: bool> CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E>, const PRINT: bool> CountBitReader<E, BR, PRINT>
Trait Implementations§
source§impl<E: Endianness, BR: BitRead<E>, const PRINT: bool> BitRead<E> for CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E>, const PRINT: bool> BitRead<E> for CountBitReader<E, BR, PRINT>
type Error = <BR as BitRead<E>>::Error
§type PeekWord = <BR as BitRead<E>>::PeekWord
type PeekWord = <BR as BitRead<E>>::PeekWord
The type we can read from the stream without advancing.
source§fn read_bits(&mut self, n_bits: usize) -> Result<u64, Self::Error>
fn read_bits(&mut self, n_bits: usize) -> Result<u64, Self::Error>
Read
n
bits and return them in the lowest bits. Read moresource§fn read_unary_param<const USE_TABLE: bool>(
&mut self
) -> Result<u64, Self::Error>
fn read_unary_param<const USE_TABLE: bool>( &mut self ) -> Result<u64, Self::Error>
Read a unary code. Read more
source§impl<E: Endianness, BR: BitRead<E> + BitSeek, const PRINT: bool> BitSeek for CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E> + BitSeek, const PRINT: bool> BitSeek for CountBitReader<E, BR, PRINT>
source§impl<E: Clone + Endianness, BR: Clone + BitRead<E>, const PRINT: bool> Clone for CountBitReader<E, BR, PRINT>
impl<E: Clone + Endianness, BR: Clone + BitRead<E>, const PRINT: bool> Clone for CountBitReader<E, BR, PRINT>
source§fn clone(&self) -> CountBitReader<E, BR, PRINT>
fn clone(&self) -> CountBitReader<E, BR, PRINT>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<E: Debug + Endianness, BR: Debug + BitRead<E>, const PRINT: bool> Debug for CountBitReader<E, BR, PRINT>
impl<E: Debug + Endianness, BR: Debug + BitRead<E>, const PRINT: bool> Debug for CountBitReader<E, BR, PRINT>
source§impl<E: Endianness, BR: BitRead<E> + DeltaRead<E>, const PRINT: bool> DeltaRead<E> for CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E> + DeltaRead<E>, const PRINT: bool> DeltaRead<E> for CountBitReader<E, BR, PRINT>
source§impl<E: Endianness, BR: BitRead<E> + GammaRead<E>, const PRINT: bool> GammaRead<E> for CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E> + GammaRead<E>, const PRINT: bool> GammaRead<E> for CountBitReader<E, BR, PRINT>
source§impl<E: Endianness, BR: BitRead<E> + ZetaRead<E>, const PRINT: bool> ZetaRead<E> for CountBitReader<E, BR, PRINT>
impl<E: Endianness, BR: BitRead<E> + ZetaRead<E>, const PRINT: bool> ZetaRead<E> for CountBitReader<E, BR, PRINT>
Auto Trait Implementations§
impl<E, BR, const PRINT: bool> RefUnwindSafe for CountBitReader<E, BR, PRINT>where
BR: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, BR, const PRINT: bool> Send for CountBitReader<E, BR, PRINT>
impl<E, BR, const PRINT: bool> Sync for CountBitReader<E, BR, PRINT>
impl<E, BR, const PRINT: bool> Unpin for CountBitReader<E, BR, PRINT>
impl<E, BR, const PRINT: bool> UnwindSafe for CountBitReader<E, BR, PRINT>where
BR: UnwindSafe,
E: UnwindSafe,
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
source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
source§impl<B> DeltaReadParam<BigEndian> for Bwhere
B: GammaReadParam<BigEndian>,
impl<B> DeltaReadParam<BigEndian> for Bwhere
B: GammaReadParam<BigEndian>,
source§impl<B> DeltaReadParam<LittleEndian> for Bwhere
B: GammaReadParam<LittleEndian>,
impl<B> DeltaReadParam<LittleEndian> for Bwhere
B: GammaReadParam<LittleEndian>,
fn read_delta_param<const USE_DELTA_TABLE: bool, const USE_GAMMA_TABLE: bool>( &mut self ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>
fn skip_delta_param<const USE_DELTA_TABLE: bool, const USE_GAMMA_TABLE: bool>( &mut self ) -> Result<(), <B as BitRead<LittleEndian>>::Error>
source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
source§impl<B> GammaReadParam<BigEndian> for B
impl<B> GammaReadParam<BigEndian> for B
source§impl<B> GammaReadParam<LittleEndian> for Bwhere
B: BitRead<LittleEndian>,
impl<B> GammaReadParam<LittleEndian> for Bwhere
B: BitRead<LittleEndian>,
fn read_gamma_param<const USE_TABLE: bool>( &mut self ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>
fn skip_gamma_param<const USE_TABLE: bool>( &mut self ) -> Result<(), <B as BitRead<LittleEndian>>::Error>
source§impl<BO, B> MinimalBinaryRead<BO> for Bwhere
BO: Endianness,
B: BitRead<BO>,
impl<BO, B> MinimalBinaryRead<BO> for Bwhere
BO: Endianness,
B: BitRead<BO>,
source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.