pub struct BitStreamWriter<'a> { /* private fields */ }Implementations§
Source§impl<'a> BitStreamWriter<'a>
impl<'a> BitStreamWriter<'a>
Sourcepub fn set_marker(&mut self, pos: Option<usize>)
pub fn set_marker(&mut self, pos: Option<usize>)
Set marker at specific position or current byte
Sourcepub fn reset_marker(&mut self)
pub fn reset_marker(&mut self)
Unset marker
Sourcepub fn slice_marker(&self, to: Option<usize>) -> &[u8] ⓘ
pub fn slice_marker(&self, to: Option<usize>) -> &[u8] ⓘ
Return slice from marker (or start if marker is unset) to specific position or current byte
If crypto is set, it will return the unencrypted (cached) slice. This is different from other slice methods which always returns the raw buffer slice.
Sourcepub fn set_crypto(&mut self, crypto: Option<Box<dyn CryptoStream>>)
pub fn set_crypto(&mut self, crypto: Option<Box<dyn CryptoStream>>)
Set crypto stream
Sourcepub fn write_small(&mut self, val: u8, bits: u8)
pub fn write_small(&mut self, val: u8, bits: u8)
Write 1-8 bits (LSB-first)
Sourcepub fn write_byte(&mut self, byte: u8)
pub fn write_byte(&mut self, byte: u8)
Write a full byte, starting at the next byte boundary
Sourcepub fn write_bytes(&mut self, data: &[u8])
pub fn write_bytes(&mut self, data: &[u8])
Write a slice of bytes, starting at the next byte boundary
Sourcepub fn write_dyn_int(&mut self, val: u128)
pub fn write_dyn_int(&mut self, val: u128)
Write a dynamic int, starting at the next byte bounary The last bit is used as a continuation flag for the next byte
Sourcepub fn write_fixed_int<const S: usize, T: FixedInt<S>>(&mut self, val: T)
pub fn write_fixed_int<const S: usize, T: FixedInt<S>>(&mut self, val: T)
Write a integer of fixed size to the buffer
Sourcepub fn align_byte(&mut self)
pub fn align_byte(&mut self)
Align the stream to the next byte boundary
Auto Trait Implementations§
impl<'a> Freeze for BitStreamWriter<'a>
impl<'a> !RefUnwindSafe for BitStreamWriter<'a>
impl<'a> !Send for BitStreamWriter<'a>
impl<'a> !Sync for BitStreamWriter<'a>
impl<'a> Unpin for BitStreamWriter<'a>
impl<'a> !UnwindSafe for BitStreamWriter<'a>
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