pub trait AsyncReadExt: AsyncRead {
// Provided method
fn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8],
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> { ... }
}Provided Methods§
Sourcefn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8],
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
fn read_exact<'a>( &'a mut self, buf: &'a mut [u8], ) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
Fills the whole given buffer, calling AsyncRead::read until it’s done.
§Errors
Returns an error if:
- reading fails
- or if the stream is closed before the buffer is filled.
§Cancel safety
This method is not cancel safe: an unknown number of bytes may already be read into buf.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".