pub trait AsyncRead {
// Required method
async fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
// Provided methods
async fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> { ... }
fn as_async_input_stream(&self) -> Option<&AsyncInputStream> { ... }
}Expand description
Read bytes from a source.
Required Methods§
Provided Methods§
async fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
fn as_async_input_stream(&self) -> Option<&AsyncInputStream>
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.