pub struct BitWriter { /* private fields */ }Expand description
MSB-first bit packer.
Implementations§
Source§impl BitWriter
impl BitWriter
Sourcepub fn write_bits(&mut self, value: u64, count: usize)
pub fn write_bits(&mut self, value: u64, count: usize)
Write count bits from value (LSB-aligned in value) into the
stream MSB-first. Bits beyond count in value are ignored.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume self and produce the byte stream (final byte zero-padded).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitWriter
impl RefUnwindSafe for BitWriter
impl Send for BitWriter
impl Sync for BitWriter
impl Unpin for BitWriter
impl UnsafeUnpin for BitWriter
impl UnwindSafe for BitWriter
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