Struct DbgBitReader

Source
pub struct DbgBitReader<E: Endianness, R> { /* private fields */ }
Expand description

A wrapper over a BitRead that report on standard error all operations performed, including all code reads.

Implementations§

Source§

impl<E: Endianness, R> DbgBitReader<E, R>

Source

pub fn new(cr: R) -> Self

Trait Implementations§

Source§

impl<E: Endianness, R: BitRead<E>> BitRead<E> for DbgBitReader<E, R>
where R::PeekWord: Display,

Source§

type Error = <R as BitRead<E>>::Error

Source§

type PeekWord = <R as BitRead<E>>::PeekWord

The type we can read from the stream without advancing.
Source§

fn peek_bits(&mut self, n_bits: usize) -> Result<Self::PeekWord, Self::Error>

Peeks at n bits without advancing the stream position. n must be nonzero, and at most PeekWord::BITS.
Source§

fn skip_bits(&mut self, n_bits: usize) -> Result<(), Self::Error>

Skip n bits from the stream. Read more
Source§

fn read_bits(&mut self, n_bits: usize) -> Result<u64, Self::Error>

Read n bits and return them in the lowest bits. Read more
Source§

fn read_unary(&mut self) -> Result<u64, Self::Error>

Read a unary code.
Source§

fn copy_to<F: Endianness, W: BitWrite<F>>( &mut self, bit_write: &mut W, n: u64, ) -> Result<(), CopyError<Self::Error, W::Error>>

Source§

impl<E: Clone + Endianness, R: Clone> Clone for DbgBitReader<E, R>

Source§

fn clone(&self) -> DbgBitReader<E, R>

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<E: Endianness, R> CopyType for DbgBitReader<E, R>
where R: MemSize, PhantomData<E>: MemSize,

Source§

impl<E: Debug + Endianness, R: Debug> Debug for DbgBitReader<E, R>

Source§

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

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

impl<E: Endianness, R: DeltaRead<E>> DeltaRead<E> for DbgBitReader<E, R>
where R::PeekWord: Display,

Source§

fn read_delta(&mut self) -> Result<u64, R::Error>

Source§

impl<E: Endianness, R: GammaRead<E>> GammaRead<E> for DbgBitReader<E, R>
where R::PeekWord: Display,

Source§

fn read_gamma(&mut self) -> Result<u64, R::Error>

Source§

impl<E: Endianness, R> MemDbgImpl for DbgBitReader<E, R>

Source§

fn _mem_dbg_rec_on( &self, _memdbg_writer: &mut impl Write, _memdbg_total_size: usize, _memdbg_max_depth: usize, _memdbg_prefix: &mut String, _memdbg_is_last: bool, _memdbg_flags: DbgFlags, ) -> Result

Source§

fn _mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, padded_size: usize, flags: DbgFlags, ) -> Result<(), Error>

Source§

impl<E: Endianness, R> MemSize for DbgBitReader<E, R>
where R: MemSize, PhantomData<E>: MemSize,

Source§

fn mem_size(&self, _memsize_flags: SizeFlags) -> usize

Returns the (recursively computed) overall memory size of the structure in bytes.
Source§

impl<E: Endianness, R: ZetaRead<E>> ZetaRead<E> for DbgBitReader<E, R>
where R::PeekWord: Display,

Source§

fn read_zeta3(&mut self) -> Result<u64, R::Error>

Source§

fn read_zeta(&mut self, k: usize) -> Result<u64, R::Error>

Auto Trait Implementations§

§

impl<E, R> Freeze for DbgBitReader<E, R>
where R: Freeze,

§

impl<E, R> RefUnwindSafe for DbgBitReader<E, R>

§

impl<E, R> Send for DbgBitReader<E, R>
where R: Send,

§

impl<E, R> Sync for DbgBitReader<E, R>
where R: Sync,

§

impl<E, R> Unpin for DbgBitReader<E, R>
where R: Unpin, E: Unpin,

§

impl<E, R> UnwindSafe for DbgBitReader<E, R>
where R: UnwindSafe, E: UnwindSafe,

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> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
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<B> DeltaReadParam<BigEndian> for B

Source§

fn read_delta_param<const USE_DELTA_TABLE: bool, const USE_GAMMA_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<BigEndian>>::Error>

Source§

impl<B> DeltaReadParam<LittleEndian> for B

Source§

fn read_delta_param<const USE_DELTA_TABLE: bool, const USE_GAMMA_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>

Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
Source§

impl<E, B> ExpGolombRead<E> for B
where E: Endianness, B: BitRead<E> + GammaRead<E>,

Source§

fn read_exp_golomb(&mut self, k: usize) -> Result<u64, Self::Error>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<B> GammaReadParam<BigEndian> for B
where B: BitRead<BigEndian>,

Source§

fn read_gamma_param<const USE_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<BigEndian>>::Error>

Source§

impl<B> GammaReadParam<LittleEndian> for B

Source§

fn read_gamma_param<const USE_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>

Source§

impl<E, B> GolombRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_golomb(&mut self, b: u64) -> Result<u64, Self::Error>

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> MemDbg for T
where T: MemDbgImpl,

Source§

fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>

Writes to stderr debug infos about the structure memory usage, expanding all levels of nested structures.
Source§

fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags, ) -> Result<(), Error>

Writes to a core::fmt::Write debug infos about the structure memory usage, expanding all levels of nested structures.
Source§

fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>

Writes to stderr debug infos about the structure memory usage as mem_dbg, but expanding only up to max_depth levels of nested structures.
Source§

fn mem_dbg_depth_on( &self, writer: &mut impl Write, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>

Writes to a core::fmt::Write debug infos about the structure memory usage as mem_dbg_on, but expanding only up to max_depth levels of nested structures.
Source§

impl<E, B> MinimalBinaryRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_minimal_binary(&mut self, max: u64) -> Result<u64, Self::Error>

Source§

impl<E, B> OmegaRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_omega(&mut self) -> Result<u64, Self::Error>

Source§

impl<E, B> PiRead<E> for B
where E: Endianness, B: BitRead<E> + RiceRead<E> + ?Sized,

Source§

fn read_pi(&mut self, k: usize) -> Result<u64, Self::Error>

Source§

impl<E, B> RiceRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_rice(&mut self, log2_b: usize) -> Result<u64, Self::Error>

Source§

impl<T> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

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

impl<T> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

impl<E, B> VByteBeRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_vbyte_be(&mut self) -> Result<u64, <B as BitRead<E>>::Error>

Source§

impl<E, B> VByteLeRead<E> for B
where E: Endianness, B: BitRead<E>,

Source§

fn read_vbyte_le(&mut self) -> Result<u64, <B as BitRead<E>>::Error>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<B> ZetaReadParam<BigEndian> for B
where B: BitRead<BigEndian>,

Source§

fn read_zeta_param( &mut self, k: usize, ) -> Result<u64, <B as BitRead<BigEndian>>::Error>

Source§

fn read_zeta3_param<const USE_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<BigEndian>>::Error>

Source§

impl<B> ZetaReadParam<LittleEndian> for B

Source§

fn read_zeta_param( &mut self, k: usize, ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>

Source§

fn read_zeta3_param<const USE_TABLE: bool>( &mut self, ) -> Result<u64, <B as BitRead<LittleEndian>>::Error>

Source§

impl<E, B> CodesRead<E> for B