pub trait ReadableStream: Send {
// Required methods
fn read_into(
&mut self,
buffer: &mut [u8],
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<usize>> + Send;
fn close(&mut self) -> impl Future<Output = Result<()>> + Send;
}Expand description
A sequential input direction. A nonempty read returns zero at EOF. Independent input and output directions must be able to make progress.
Required Methods§
Sourcefn read_into(
&mut self,
buffer: &mut [u8],
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<usize>> + Send
fn read_into( &mut self, buffer: &mut [u8], cancellation: &Cancellation, ) -> impl Future<Output = OperationResult<usize>> + Send
Read a possibly short prefix. Empty storage does not establish EOF.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".