Trait AsyncWriteExt
trait AsyncWriteExt: AsyncWrite
An extension trait which adds utility methods to AsyncWrite types.
Provided Methods
fn flush(self: &mut Self) -> Flush<'_, Self> where Self: UnpinCreates a future which will entirely flush this
AsyncWrite.Examples
# block_on.unwrap;fn close(self: &mut Self) -> Close<'_, Self> where Self: UnpinCreates a future which will entirely close this
AsyncWrite.fn write<'a>(self: &'a mut Self, buf: &'a [u8]) -> Write<'a, Self> where Self: UnpinCreates 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>(self: &'a mut Self, bufs: &'a [IoSlice<'a>]) -> WriteVectored<'a, Self> where Self: UnpinCreates 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>(self: &'a mut Self, buf: &'a [u8]) -> WriteAll<'a, Self> where Self: UnpinWrite 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: Self) -> IntoSink<Self, Item> where Self: SizedAllow 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 Sinkimpl<W: AsyncWrite + ?Sized> AsyncWriteExt for Wimpl<W> AsyncWriteExt for IntoAsyncRead<St>impl<W> AsyncWriteExt for Either<A, B>impl<W> AsyncWriteExt for BufReader<R>impl<W> AsyncWriteExt for LineWriter<W>impl<W> AsyncWriteExt for Cursor<T>impl<W> AsyncWriteExt for BufWriter<W>impl<W> AsyncWriteExt for AllowStdIo<T>impl<W> AsyncWriteExt for WriteHalf<T>