Struct InBuffer
pub struct InBuffer<'a> { pub src: &'a [u8], pub pos: usize }
Wrapper around an input buffer.
Bytes will be read starting at src[pos].
pos will be updated after reading.
Invariant
pos <= src.len()
Both fields are public, so this is checked (and panics if it does not hold) whenever the buffer is given to zstd.
Fields
src: &'a [u8]pos: usize
Implementations
impl<'a> InBuffer<'a>
fn around(src: &'a [u8]) -> SelfReturns a new
InBufferaround the given slice.Starts with
pos = 0.fn pos(&self) -> usizeReturns the current cursor position.
fn set_pos(&mut self, pos: usize)Sets the new cursor position.
Panics
If
pos > self.src.len().
Trait Implementations
impl<'a> Debug for InBuffer<'a>
fn fmt(&self, f: &mut Formatter<'_>) -> Result