pub trait WritableStream: Send {
// Required methods
fn write(
&mut self,
buffer: &[u8],
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<usize>> + Send;
fn flush(
&mut self,
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<()>> + Send;
fn close(&mut self) -> impl Future<Output = Result<()>> + Send;
}Expand description
An ordered output direction. Accepted bytes must not be replayed after a cancelled flush; flush establishes delivery to the underlying transport.
Required Methods§
Sourcefn write(
&mut self,
buffer: &[u8],
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<usize>> + Send
fn write( &mut self, buffer: &[u8], cancellation: &Cancellation, ) -> impl Future<Output = OperationResult<usize>> + Send
Accept a possibly short prefix, reporting progress before another wait.
Sourcefn flush(
&mut self,
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<()>> + Send
fn flush( &mut self, cancellation: &Cancellation, ) -> impl Future<Output = OperationResult<()>> + Send
Deliver all previously accepted bytes, without closing the direction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".