pub struct BitStreamReader<'a> { /* private fields */ }Implementations§
Source§impl<'a> BitStreamReader<'a>
impl<'a> BitStreamReader<'a>
Sourcepub fn slice(&self, from_start: bool) -> &[u8] ⓘ
pub fn slice(&self, from_start: bool) -> &[u8] ⓘ
Return slice from reading position (or start, if from_start is true) to offset-end
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 set_offset_end(&mut self, len: usize)
pub fn set_offset_end(&mut self, len: usize)
Set integrity offset to ignore when reading
Sourcepub fn read_bit(&mut self) -> Result<bool, DeserializationError>
pub fn read_bit(&mut self) -> Result<bool, DeserializationError>
Read a single bit
Sourcepub fn read_small(&mut self, bits: u8) -> Result<u8, DeserializationError>
pub fn read_small(&mut self, bits: u8) -> Result<u8, DeserializationError>
Read 1-8 bits as u8 (LSB-first)
Sourcepub fn read_byte(&mut self) -> Result<u8, DeserializationError>
pub fn read_byte(&mut self) -> Result<u8, DeserializationError>
Read a full byte, aligning to the next byte boundary
Sourcepub fn read_bytes(
&mut self,
count: usize,
) -> Result<&[u8], DeserializationError>
pub fn read_bytes( &mut self, count: usize, ) -> Result<&[u8], DeserializationError>
Read a slice of bytes, aligning first
Sourcepub fn read_dyn_int(&mut self) -> Result<u128, DeserializationError>
pub fn read_dyn_int(&mut self) -> Result<u128, DeserializationError>
Read a dynamic int, starting at the next byte bounary The last bit is used as a continuation flag for the next byte
Sourcepub fn read_fixed_int<const S: usize, T: FixedInt<S>>(
&mut self,
) -> Result<T, DeserializationError>
pub fn read_fixed_int<const S: usize, T: FixedInt<S>>( &mut self, ) -> Result<T, DeserializationError>
Read a integer of fixed size from the buffer
Sourcepub fn align_byte(&mut self)
pub fn align_byte(&mut self)
Align the reader to the next byte boundary
Sourcepub fn bytes_left(&self) -> usize
pub fn bytes_left(&self) -> usize
Get bytes left
Auto Trait Implementations§
impl<'a> Freeze for BitStreamReader<'a>
impl<'a> !RefUnwindSafe for BitStreamReader<'a>
impl<'a> !Send for BitStreamReader<'a>
impl<'a> !Sync for BitStreamReader<'a>
impl<'a> Unpin for BitStreamReader<'a>
impl<'a> !UnwindSafe for BitStreamReader<'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