pub trait AsyncStreamReader {
    // Required method
    fn read(&mut self, len: usize) -> impl Future<Output = Result<Bytes>>;
}
Expand description

A non seekable reader, e.g. a network socket.

Required Methods§

source

fn read(&mut self, len: usize) -> impl Future<Output = Result<Bytes>>

Read at most len bytes. To read to the end, pass u64::MAX.

returns an empty buffer to indicate EOF.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsyncStreamReader for Bytes

source§

async fn read(&mut self, len: usize) -> Result<Bytes>

source§

impl<T: AsyncStreamReader> AsyncStreamReader for &mut T

source§

async fn read(&mut self, len: usize) -> Result<Bytes>

Implementors§