Struct InBuffer

struct InBuffer<'a> { ... }

Wrapper around an input buffer.

Bytes will be read starting at src[pos].

pos will be updated after reading.

Fields

src: &'a [u8]
pos: usize

Implementations

impl<'a> InBuffer<'a>

fn around(src: &'a [u8]) -> Self

Returns a new InBuffer around the given slice.

Starts with pos = 0.

fn pos(self: &Self) -> usize

Returns the current cursor position.

fn set_pos(self: &mut Self, pos: usize)

Sets the new cursor position.

Panics

If pos > self.src.len().

impl<'a> Debug for InBuffer<'a>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'a> Freeze for InBuffer<'a>

impl<'a> RefUnwindSafe for InBuffer<'a>

impl<'a> Send for InBuffer<'a>

impl<'a> Sync for InBuffer<'a>

impl<'a> Unpin for InBuffer<'a>

impl<'a> UnsafeUnpin for InBuffer<'a>

impl<'a> UnwindSafe for InBuffer<'a>

impl<T> Any for InBuffer<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for InBuffer<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for InBuffer<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for InBuffer<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for InBuffer<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for InBuffer<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for InBuffer<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>