Trait AsyncRead

Source
pub trait AsyncRead<Error> {
    // Required method
    async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>;
}
Expand description

IO AsyncRead type with an error parameter

Required Methods§

Source

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Read bytes into the buffer

§Errors

Returns an error if an IO error occurs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> AsyncRead<Infallible> for &'a [u8]

Source§

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Infallible>

Implementors§