pub struct Cursor<'input> { /* private fields */ }Implementations§
Source§impl<'input> Cursor<'input>
impl<'input> Cursor<'input>
pub fn new(buffer: &'input [u8]) -> Self
pub fn is_at_end(&self) -> bool
pub fn peek(&self, bits: u8) -> Result<u64, Error>
pub fn read(&mut self, bits: u8) -> Result<u64, Error>
pub fn read_bytes(&mut self, length_bytes: usize) -> Result<&'input [u8], Error>
pub fn skip_bytes(&mut self, count: usize) -> Result<(), Error>
Sourcepub fn read_vbr(&mut self, width: u8) -> Result<u64, Error>
pub fn read_vbr(&mut self, width: u8) -> Result<u64, Error>
Read a VBR number in width-wide encoding.
The number may be up to 64-bit long regardless of the width.
Sourcepub fn align32(&mut self) -> Result<(), Error>
pub fn align32(&mut self) -> Result<(), Error>
Skip bytes until a 32-bit boundary (no-op if already aligned)
Sourcepub fn unconsumed_bit_len(&self) -> usize
pub fn unconsumed_bit_len(&self) -> usize
Maximum number of bits that can be read
Trait Implementations§
Auto Trait Implementations§
impl<'input> Freeze for Cursor<'input>
impl<'input> RefUnwindSafe for Cursor<'input>
impl<'input> Send for Cursor<'input>
impl<'input> Sync for Cursor<'input>
impl<'input> Unpin for Cursor<'input>
impl<'input> UnwindSafe for Cursor<'input>
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