Skip to main content

AsyncWrite

Trait AsyncWrite 

Source
pub trait AsyncWrite {
    // Required method
    fn write(&self, buf: &[u8]) -> impl Future<Output = Result<usize>> + Send;
}
Expand description

Async byte-stream write — the write-side twin of AsyncRead; see its doc for the shared rationale.

Required Methods§

Source

fn write(&self, buf: &[u8]) -> impl Future<Output = Result<usize>> + Send

Write from buf, returning the number of bytes written.

§Errors

Returns whatever the underlying stream’s own write returns.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§