pub struct SliceReader<'de> { /* private fields */ }
Expand description
An efficient Reader wrapper around a slice.
Implementations§
Trait Implementations§
Source§impl<'de> Reader<'de> for SliceReader<'de>
impl<'de> Reader<'de> for SliceReader<'de>
Source§type Error = SliceReaderError
type Error = SliceReaderError
Error type raised by the current reader.
Source§fn read_bytes<V>(&mut self, n: usize, visitor: V) -> Result<V::Ok, V::Error>
fn read_bytes<V>(&mut self, n: usize, visitor: V) -> Result<V::Ok, V::Error>
Read a slice out of the current reader.
Source§fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Read a slice into the given buffer.
Source§fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
Read an array out of the current reader.
Source§fn with_position(self) -> WithPosition<Self>where
Self: Sized,
fn with_position(self) -> WithPosition<Self>where
Self: Sized,
Keep an accurate record of the position within the reader.
Auto Trait Implementations§
impl<'de> Freeze for SliceReader<'de>
impl<'de> RefUnwindSafe for SliceReader<'de>
impl<'de> !Send for SliceReader<'de>
impl<'de> !Sync for SliceReader<'de>
impl<'de> Unpin for SliceReader<'de>
impl<'de> UnwindSafe for SliceReader<'de>
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