pub struct Input<'a> { /* private fields */ }Implementations§
Source§impl<'a> Input<'a>
impl<'a> Input<'a>
pub fn new(buf: &'a mut &'a [u8]) -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn advance(&mut self, len: usize) -> Result<&[u8], FormatError>
pub fn advance(&mut self, len: usize) -> Result<&[u8], FormatError>
Splits the first len bytes from the input, returning them as a slice and updating the input buffer.
Returns an error if there are not enough bytes remaining to fulfill the request.
Sourcepub fn local_peek_bytes(&self, len: usize) -> Result<&[u8], FormatError>
pub fn local_peek_bytes(&self, len: usize) -> Result<&[u8], FormatError>
Similar to advance(), but does not advance the input, only returns a reference to the next len bytes.
Not to be confused with the struct-wide peeking functionality that switches between consuming the buffer and advancing a cursor.
Sourcepub fn local_peek_byte(&self, offset: usize) -> Result<u8, FormatError>
pub fn local_peek_byte(&self, offset: usize) -> Result<u8, FormatError>
Similar to local_peek_bytes(), but returns a single byte.
Not to be confused with the struct-wide peeking functionality that switches between consuming the buffer and advancing a cursor.
pub fn start_peek(&mut self)
Sourcepub fn peek_cursor(&self) -> usize
pub fn peek_cursor(&self) -> usize
The peek cursor from the view of the current innermost peek.
Auto Trait Implementations§
impl<'a> Freeze for Input<'a>
impl<'a> RefUnwindSafe for Input<'a>
impl<'a> Send for Input<'a>
impl<'a> Sync for Input<'a>
impl<'a> Unpin for Input<'a>
impl<'a> UnsafeUnpin for Input<'a>
impl<'a> !UnwindSafe for Input<'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