Skip to main content

AsyncWriteExt

Trait AsyncWriteExt 

Source
pub trait AsyncWriteExt: AsyncWrite {
    // Provided method
    fn write_all<'a>(
        &'a mut self,
        buf: &'a [u8],
    ) -> impl Future<Output = Result<(), WriteAllError<Self::Error>>> { ... }
}
Expand description

Helper methods on top of AsyncWrite, implemented for every AsyncWrite.

Provided Methods§

Source

fn write_all<'a>( &'a mut self, buf: &'a [u8], ) -> impl Future<Output = Result<(), WriteAllError<Self::Error>>>

Writes the whole given buffer, calling AsyncWrite::write until it’s done.

§Errors

Returns an error if writing fails or if the stream accepts zero bytes.

§Cancel safety

This method is not cancel safe: an unknown number of bytes from buf may already be written.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§