Struct dsi_bitstream::utils::CountBitWriter
source · pub struct CountBitWriter<E: Endianness, BW: BitWrite<E>, const PRINT: bool = false> {
pub bits_written: usize,
/* private fields */
}
Expand description
A wrapper around a BitWrite
that keeps track of the number of
bits written and optionally prints on standard error the operations performed on the stream.
Fields§
§bits_written: usize
The number of bits written so far on the underlying BitWrite
.
Implementations§
source§impl<E: Endianness, BW: BitWrite<E>, const PRINT: bool> CountBitWriter<E, BW, PRINT>
impl<E: Endianness, BW: BitWrite<E>, const PRINT: bool> CountBitWriter<E, BW, PRINT>
Trait Implementations§
source§impl<E: Endianness, BR: BitWrite<E> + BitSeek, const PRINT: bool> BitSeek for CountBitWriter<E, BR, PRINT>
impl<E: Endianness, BR: BitWrite<E> + BitSeek, const PRINT: bool> BitSeek for CountBitWriter<E, BR, PRINT>
source§impl<E: Endianness, BW: BitWrite<E>, const PRINT: bool> BitWrite<E> for CountBitWriter<E, BW, PRINT>
impl<E: Endianness, BW: BitWrite<E>, const PRINT: bool> BitWrite<E> for CountBitWriter<E, BW, PRINT>
type Error = <BW as BitWrite<E>>::Error
source§fn write_bits(
&mut self,
value: u64,
n_bits: usize
) -> Result<usize, Self::Error>
fn write_bits( &mut self, value: u64, n_bits: usize ) -> Result<usize, Self::Error>
Write the lowest
n
bits of value
to the stream and return the number
of bits written, that is, n
. Read moresource§fn write_unary_param<const USE_TABLE: bool>(
&mut self,
value: u64
) -> Result<usize, Self::Error>
fn write_unary_param<const USE_TABLE: bool>( &mut self, value: u64 ) -> Result<usize, Self::Error>
Write
value
as a unary code to the stream and return the number of
bits written, that is, value
plus one. Read moresource§impl<E: Clone + Endianness, BW: Clone + BitWrite<E>, const PRINT: bool> Clone for CountBitWriter<E, BW, PRINT>
impl<E: Clone + Endianness, BW: Clone + BitWrite<E>, const PRINT: bool> Clone for CountBitWriter<E, BW, PRINT>
source§fn clone(&self) -> CountBitWriter<E, BW, PRINT>
fn clone(&self) -> CountBitWriter<E, BW, 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, BW: Debug + BitWrite<E>, const PRINT: bool> Debug for CountBitWriter<E, BW, PRINT>
impl<E: Debug + Endianness, BW: Debug + BitWrite<E>, const PRINT: bool> Debug for CountBitWriter<E, BW, PRINT>
source§impl<E: Endianness, BW: BitWrite<E> + DeltaWrite<E>, const PRINT: bool> DeltaWrite<E> for CountBitWriter<E, BW, PRINT>
impl<E: Endianness, BW: BitWrite<E> + DeltaWrite<E>, const PRINT: bool> DeltaWrite<E> for CountBitWriter<E, BW, PRINT>
source§impl<E: Endianness, BW: BitWrite<E> + GammaWrite<E>, const PRINT: bool> GammaWrite<E> for CountBitWriter<E, BW, PRINT>
impl<E: Endianness, BW: BitWrite<E> + GammaWrite<E>, const PRINT: bool> GammaWrite<E> for CountBitWriter<E, BW, PRINT>
Auto Trait Implementations§
impl<E, BW, const PRINT: bool> RefUnwindSafe for CountBitWriter<E, BW, PRINT>where
BW: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, BW, const PRINT: bool> Send for CountBitWriter<E, BW, PRINT>
impl<E, BW, const PRINT: bool> Sync for CountBitWriter<E, BW, PRINT>
impl<E, BW, const PRINT: bool> Unpin for CountBitWriter<E, BW, PRINT>
impl<E, BW, const PRINT: bool> UnwindSafe for CountBitWriter<E, BW, PRINT>where
BW: 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> DeltaWriteParam<BigEndian> for Bwhere
B: GammaWriteParam<BigEndian>,
impl<B> DeltaWriteParam<BigEndian> for Bwhere
B: GammaWriteParam<BigEndian>,
source§impl<B> DeltaWriteParam<LittleEndian> for Bwhere
B: GammaWriteParam<LittleEndian>,
impl<B> DeltaWriteParam<LittleEndian> for Bwhere
B: GammaWriteParam<LittleEndian>,
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> GammaWriteParam<BigEndian> for B
impl<B> GammaWriteParam<BigEndian> for B
source§impl<B> GammaWriteParam<LittleEndian> for Bwhere
B: BitWrite<LittleEndian>,
impl<B> GammaWriteParam<LittleEndian> for Bwhere
B: BitWrite<LittleEndian>,
fn write_gamma_param<const USE_TABLE: bool>( &mut self, n: u64 ) -> Result<usize, <B as BitWrite<LittleEndian>>::Error>
source§impl<BO, B> MinimalBinaryWrite<BO> for Bwhere
BO: Endianness,
B: BitWrite<BO>,
impl<BO, B> MinimalBinaryWrite<BO> for Bwhere
BO: Endianness,
B: BitWrite<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.