Struct lzss::SliceReader
source · pub struct SliceReader<'a> { /* private fields */ }
Expand description
Read from a slice.
let input_data = [10, 42];
let mut input = SliceReader::new(&input_data);
assert_eq!(input.read(), Ok(Some(10)));
assert_eq!(input.read(), Ok(Some(42)));
assert_eq!(input.read(), Ok(None));
Use void_read_unwrap
to remove the Void from the result.
Or void_unwrap
if also the writer produces Void.
Implementations§
source§impl<'a> SliceReader<'a>
impl<'a> SliceReader<'a>
sourcepub fn new(data: &'a [u8]) -> SliceReader<'a>
pub fn new(data: &'a [u8]) -> SliceReader<'a>
Constructs a new reader.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for SliceReader<'a>
impl<'a> Send for SliceReader<'a>
impl<'a> Sync for SliceReader<'a>
impl<'a> Unpin for SliceReader<'a>
impl<'a> UnwindSafe for SliceReader<'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