pub struct BitWriter<W: Write> { /* private fields */ }
Implementations§
Source§impl<W: Write> BitWriter<W>
impl<W: Write> BitWriter<W>
pub fn new(writer: W) -> Self
Sourcepub fn write_f<T: Into<u32>>(
&mut self,
bits: usize,
value: T,
) -> BitWriterResult<usize>
pub fn write_f<T: Into<u32>>( &mut self, bits: usize, value: T, ) -> BitWriterResult<usize>
Writes fixed bit size integer (up to 32 bit)
Sourcepub fn write_bit(&mut self, bit: bool) -> BitWriterResult<()>
pub fn write_bit(&mut self, bit: bool) -> BitWriterResult<()>
Takes a single bit that will be outputed to std::io::Write
Sourcepub fn flush(&mut self) -> BitWriterResult<()>
pub fn flush(&mut self) -> BitWriterResult<()>
Immediately outputs any cached bits to std::io::Write
Sourcepub fn has_data_pending(&self) -> bool
pub fn has_data_pending(&self) -> bool
Returns true
if [’Self] hold data that wasn't written to [
std::io::Write`]
Trait Implementations§
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