pub struct SliceReader<'storage> { /* private fields */ }Expand description
A reader type for &[u8] slices. Implements both [Reader] and [BorrowReader], and thus can be used for borrowed data.
Implementations§
Trait Implementations§
Source§impl<'storage> BorrowReader<'storage> for SliceReader<'storage>
impl<'storage> BorrowReader<'storage> for SliceReader<'storage>
Source§fn take_bytes(&mut self, length: usize) -> Result<&'storage [u8], DecodeError>
fn take_bytes(&mut self, length: usize) -> Result<&'storage [u8], DecodeError>
Read exactly
length bytes and return a slice to this data. If not enough bytes could be read, an error should be returned. Read moreSource§impl<'storage> Reader for SliceReader<'storage>
impl<'storage> Reader for SliceReader<'storage>
Source§fn read(&mut self, bytes: &mut [u8]) -> Result<(), DecodeError>
fn read(&mut self, bytes: &mut [u8]) -> Result<(), DecodeError>
Fill the given
bytes argument with values. Exactly the length of the given slice must be filled, or else an error must be returned.
Fill the given bytes argument with values. Exactly the length of the given slice must be filled, or else an error must be returned. Read moreAuto Trait Implementations§
impl<'storage> Freeze for SliceReader<'storage>
impl<'storage> RefUnwindSafe for SliceReader<'storage>
impl<'storage> Send for SliceReader<'storage>
impl<'storage> Sync for SliceReader<'storage>
impl<'storage> Unpin for SliceReader<'storage>
impl<'storage> UnwindSafe for SliceReader<'storage>
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