pub struct IoReader<R> { /* private fields */ }Available on crate feature
std and (crate features alloc or derive or serde or static-size or std or zero-copy) only.Expand description
A reader that reads from a std::io::Read.
Implementations§
Trait Implementations§
Source§impl<R> Reader for IoReader<R>where
R: Read,
impl<R> Reader for IoReader<R>where
R: Read,
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.
The buffer is initialized, and implementations may inspect its contents before writing. Read moreSource§fn read_u8(&mut self) -> Result<u8, DecodeError>
fn read_u8(&mut self) -> Result<u8, DecodeError>
Read a single byte from the reader. Read more
Source§fn peek_read(&mut self, _: usize) -> Option<&[u8]>
fn peek_read(&mut self, _: usize) -> Option<&[u8]>
If this reader wraps a buffer of any kind, this function lets callers access contents of
the buffer without passing data through a buffer first.
Auto Trait Implementations§
impl<R> Forget for IoReader<R>
impl<R> Freeze for IoReader<R>where
R: Freeze,
impl<R> Move for IoReader<R>
impl<R> RefUnwindSafe for IoReader<R>where
R: RefUnwindSafe,
impl<R> Send for IoReader<R>where
R: Send,
impl<R> Sync for IoReader<R>where
R: Sync,
impl<R> Unpin for IoReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for IoReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for IoReader<R>where
R: UnwindSafe,
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