pub(crate) struct BitWriter<W> {
w: W,
accumulator: u32,
nbits: u8,
}
Fields§
§w: W
§accumulator: u32
§nbits: u8
Implementations§
source§impl<W: Write> BitWriter<W>
impl<W: Write> BitWriter<W>
fn new(w: W) -> Self
fn write_bits(&mut self, bits: u16, size: u8) -> Result<()>
fn pad_byte(&mut self) -> Result<()>
fn huffman_encode(&mut self, val: u8, table: &[(u8, u16); 256]) -> Result<()>
fn write_block( &mut self, block: &[i32; 64], prevdc: i32, dctable: &[(u8, u16); 256], actable: &[(u8, u16); 256], ) -> Result<i32>
fn write_marker(&mut self, marker: u8) -> Result<()>
fn write_segment(&mut self, marker: u8, data: &[u8]) -> Result<()>
Auto Trait Implementations§
impl<W> Freeze for BitWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for BitWriter<W>where
W: RefUnwindSafe,
impl<W> Send for BitWriter<W>where
W: Send,
impl<W> Sync for BitWriter<W>where
W: Sync,
impl<W> Unpin for BitWriter<W>where
W: Unpin,
impl<W> UnwindSafe for BitWriter<W>where
W: 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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more