pub struct BitWriter<W, P>{ /* private fields */ }
Expand description
BitWriter is a writer for single bit values
Bits will be grouped to a single byte before writing to the inner writer. The first Bit will be the most significant bit of the byte.
When dropping this writer, any remaining bits will be written according to the padding used. The default padding is NoPadding
§Examples
extern crate bitstream;
let vec = Vec::new();
let mut bit_writer = bitstream::BitWriter::new(vec);
assert!(bit_writer.write_bit(true).is_ok());
assert!(bit_writer.write_bit(false).is_ok());
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<W, P> Freeze for BitWriter<W, P>
impl<W, P> RefUnwindSafe for BitWriter<W, P>where
W: RefUnwindSafe,
P: RefUnwindSafe,
impl<W, P> Send for BitWriter<W, P>
impl<W, P> Sync for BitWriter<W, P>
impl<W, P> Unpin for BitWriter<W, P>
impl<W, P> UnwindSafe for BitWriter<W, P>where
W: UnwindSafe,
P: 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