pub struct BitWriter { /* private fields */ }Expand description
MSB-first bit writer accumulating into an owned Vec<u8>.
Implementations§
Source§impl BitWriter
impl BitWriter
Sourcepub fn byte_aligned(&self) -> bool
pub fn byte_aligned(&self) -> bool
True if the next write would start on a byte boundary.
Sourcepub fn write_bits(&mut self, value: u32, n: u32)
pub fn write_bits(&mut self, value: u32, n: u32)
Write the low n bits of value MSB-first. n must be ≤ 32;
bits above bit n-1 of value are ignored.
Sourcepub fn write_bits_u64(&mut self, value: u64, n: u32)
pub fn write_bits_u64(&mut self, value: u64, n: u32)
Write the low n bits of a u64 MSB-first. n must be ≤ 64.
Sourcepub fn write_ue(&mut self, value: u32) -> Result<(), BitstreamError>
pub fn write_ue(&mut self, value: u32) -> Result<(), BitstreamError>
Write an unsigned Exp-Golomb (ue(v)) code — the inverse of
BitReader::ue. Refuses
u32::MAX because code_num = value + 1 would overflow.
Sourcepub fn write_se(&mut self, value: i32) -> Result<(), BitstreamError>
pub fn write_se(&mut self, value: i32) -> Result<(), BitstreamError>
Write a signed Exp-Golomb (se(v)) code — the inverse of
BitReader::se.
Sourcepub fn align_to_byte(&mut self)
pub fn align_to_byte(&mut self)
Pad with zero bits up to the next byte boundary.
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