pub trait AsyncStreamReader {
// Required methods
fn read_bytes(&mut self, len: usize) -> impl Future<Output = Result<Bytes>>;
fn read<const L: usize>(&mut self) -> impl Future<Output = Result<[u8; L]>>;
// Provided methods
fn read_bytes_exact(
&mut self,
len: usize,
) -> impl Future<Output = Result<Bytes>> { ... }
fn read_exact<const L: usize>(
&mut self,
) -> impl Future<Output = Result<[u8; L]>> { ... }
}
Expand description
A non seekable reader, e.g. a network socket.
Required Methods§
Provided Methods§
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.