IoReader

Struct IoReader 

Source
pub struct IoReader<R> { /* private fields */ }
Available on crate feature std only.
Expand description

A reader that reads from a std::io::Read.

Implementations§

Source§

impl<R> IoReader<R>

Source

pub const fn new(reader: R) -> Self

Create a new IoReader from the given reader.

Trait Implementations§

Source§

impl<R> Reader for IoReader<R>
where R: Read,

Source§

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 more
Source§

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.
Source§

fn consume(&mut self, _: usize)

If an implementation of peek_read is provided, an implementation of this function must be provided so that subsequent reads or peek-reads do not return the same bytes

Auto Trait Implementations§

§

impl<R> Freeze for IoReader<R>
where R: Freeze,

§

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> UnwindSafe for IoReader<R>
where R: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.