pub struct Reader<'a> { /* private fields */ }
Expand description
Structure for reading over a vec of bytes using a cursor.
Implementations
sourceimpl<'a> Reader<'a>
impl<'a> Reader<'a>
sourcepub fn take(&mut self, count: usize) -> CodecResult<&[u8]>
pub fn take(&mut self, count: usize) -> CodecResult<&[u8]>
Attempts to take a slice of the buffer after
the cursor with the provided count
number
of bytes. Returns None if theres not enough
bytes after the cursor
sourcepub fn take_one(&mut self) -> CodecResult<u8>
pub fn take_one(&mut self) -> CodecResult<u8>
Takes a single bytes from the reader increasing the cursor by one.
sourcepub fn consume_while<F: Fn(u8) -> bool>(&mut self, test: F)
pub fn consume_while<F: Fn(u8) -> bool>(&mut self, test: F)
Consumes every byte until the condition function fails
pub fn mark(&mut self)
pub fn reset_marker(&mut self)
Auto Trait Implementations
impl<'a> RefUnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnwindSafe for Reader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more