pub struct BitWriter { /* private fields */ }
Implementations§
Source§impl BitWriter
impl BitWriter
pub fn new() -> BitWriter
pub fn write_u16(&mut self, v: u16, bit_count: u8) -> Result<()>
pub fn write_u32(&mut self, v: u32, bit_count: u8) -> Result<()>
pub fn write_u64(&mut self, v: u64, bit_count: u8) -> Result<()>
pub fn write_i8(&mut self, v: i8, bit_count: u8) -> Result<()>
pub fn write_i16(&mut self, v: i16, bit_count: u8) -> Result<()>
pub fn write_i32(&mut self, v: i32, bit_count: u8) -> Result<()>
pub fn write_i64(&mut self, v: i64, bit_count: u8) -> Result<()>
pub fn write_bool(&mut self, v: bool) -> Result<()>
pub fn skip(&mut self, n: u64) -> Result<()>
pub fn align(&mut self, alignment_bytes: u32) -> Result<()>
pub fn write_signed_bits( &mut self, v: i64, n: u8, maximum_count: u8, ) -> Result<()>
pub fn write_unsigned_bits( &mut self, v: u64, n: u8, maximum_count: u8, ) -> Result<()>
Sourcepub fn write(&mut self, data: &Vec<u8>) -> Result<()>
pub fn write(&mut self, data: &Vec<u8>) -> Result<()>
Writes a number of full bytes into the stream. This will give best performance if the data is aligned to a byte boundary. Otherwise, each data bytes will be spread across two bytes in the bitstream. Byte boundary can be ensured by using align().
pub fn close(&mut self) -> Result<()>
pub fn data(&self) -> &Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for BitWriter
impl RefUnwindSafe for BitWriter
impl Send for BitWriter
impl Sync for BitWriter
impl Unpin 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