Struct ZCursor

pub struct ZCursor<T> { /* private fields */ }

Wraps an in memory buffer providing it with a Seek method but works in no_std environments

std::io::Cursor is available in std environments, but we also need support for no_std environments so this serves as a drop in replacement

Implementations

impl<T: AsRef<[u8]>> ZCursor<T>

fn skip(&mut self, num: usize)

Move forward num bytes from the current position.

It doesn't check that position overflowed, new position may point past the internal buffer, all subsequent reads will either return an error or zero depending on the method called

fn rewind(&mut self, num: usize)

Move back num bytes from the current position

This saturates at zero, it can never be negative or wraparound when the value becomes too small

fn split(&self) -> (&[u8], &[u8])

impl<T: AsRef<[u8]>> ZCursor<T>

fn new(buffer: T) -> ZCursor<T>

Trait Implementations

impl<T: AsRef<[u8]>> BufRead for ZCursor<T>

fn fill_buf(&mut self) -> Result<&[u8]>
fn consume(&mut self, amount: usize)

impl<T: AsRef<[u8]>> From<T> for ZCursor<T>

fn from(value: T) -> Self

impl<T: AsRef<[u8]>> Read for ZCursor<T>

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

impl<T: AsRef<[u8]>> Seek for ZCursor<T>

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Auto Trait Implementations

impl<T> Freeze for ZCursor<T> where T: Freeze,

impl<T> RefUnwindSafe for ZCursor<T> where T: RefUnwindSafe,

impl<T> Send for ZCursor<T> where T: Send,

impl<T> Sync for ZCursor<T> where T: Sync,

impl<T> Unpin for ZCursor<T> where T: Unpin,

impl<T> UnsafeUnpin for ZCursor<T> where T: UnsafeUnpin,

impl<T> UnwindSafe for ZCursor<T> where T: UnwindSafe,

Blanket Implementations

impl<T> Any for ZCursor<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for ZCursor<T> where T: ?Sized,

impl<T> BorrowMut<T> for ZCursor<T> where T: ?Sized,

impl<T> From<T> for ZCursor<T>

impl<T> ZByteReaderTrait for ZCursor<T> where T: BufRead + Seek,

impl<T, U> Into<U> for ZCursor<T> where U: From<T>,

impl<T, U> TryFrom<U> for ZCursor<T> where U: Into<T>,

impl<T, U> TryInto<U> for ZCursor<T> where U: TryFrom<T>,