Trait AsyncWriteExt
pub trait AsyncWriteExt: AsyncWrite
An extension trait which adds utility methods to AsyncWrite types.
Provided Methods
fn flush(&mut self) -> Flush<'_, Self> where Self: Unpin,Creates a future which will entirely flush this
AsyncWrite.Examples
# block_on.unwrap;fn close(&mut self) -> Close<'_, Self> where Self: Unpin,Creates a future which will entirely close this
AsyncWrite.fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where Self: Unpin,Creates a future which will write bytes from
bufinto the object.The returned future will resolve to the number of bytes written once the write operation is completed.
fn write_vectored<'a>(&'a mut self, bufs: &'a [IoSlice<'a>]) -> WriteVectored<'a, Self> where Self: Unpin,Creates a future which will write bytes from
bufsinto the object using vectored IO operations.The returned future will resolve to the number of bytes written once the write operation is completed.
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> where Self: Unpin,Write data into this object.
Creates a future that will write the entire contents of the buffer
bufinto thisAsyncWrite.The returned future will not complete until all the data has been written.
Examples
# block_on.unwrap;fn into_sink<Item: AsRef<[u8]>>(self) -> IntoSink<Self, Item> where Self: Sized,Allow using an
AsyncWriteas aSink<Item: AsRef<[u8]>>.This adapter produces a sink that will write each value passed to it into the underlying writer.
Note that this function consumes the given writer, returning a wrapped version.
Examples
# block_on?; # Ok::
Implementors
impl<W> AsyncWriteExt for AllowStdIo<T> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for BufReader<R> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for BufWriter<W> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for Cursor<T> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for Either<A, B> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for IntoAsyncRead<St> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for LineWriter<W> where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for Sink where W: AsyncWrite + ?Sized,impl<W> AsyncWriteExt for WriteHalf<T> where W: AsyncWrite + ?Sized,impl<W: AsyncWrite + ?Sized> AsyncWriteExt for W