Trait completion_io::AsyncWriteWith [−][src]
Write bytes to a source asynchronously with a specific lifetime.
Associated Types
type WriteFuture: CompletionFuture<Output = Result<usize>>
[src]
The future that writes to the source, and outputs the number of bytes written.
type WriteVectoredFuture: CompletionFuture<Output = Result<usize>>
[src]
The future that writes a vector of buffers to the source, and outputs the number of bytes
written. If your writer does not have efficient vectored writes, set this to
DefaultWriteVectored<'a, Self>
.
type FlushFuture: CompletionFuture<Output = Result<()>>
[src]
The future that flushes the output stream.
Required methods
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
Write a buffer to the writer, returning how many bytes were written.
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
Like write
, except that it writes from a slice of buffers.
Data is copied from each buffer in order, with the final buffer read from possibly being
only partially consumed. This method must behave as a call to write
with
the buffers concatenated would.
If your writer does not have efficient vectored writes, call
DefaultWriteVectored::new(self, bufs)
.
fn flush(&'a mut self) -> Self::FlushFuture
[src]
Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Provided methods
fn is_write_vectored(&self) -> bool
[src]
Determines if this AsyncWrite
r has an efficient write_vectored
implementation.
The default implementation returns false
.
Implementations on Foreign Types
impl<'a, W: AsyncWriteWith<'a> + ?Sized> AsyncWriteWith<'a> for &mut W
[src]
type WriteFuture = W::WriteFuture
type WriteVectoredFuture = W::WriteVectoredFuture
type FlushFuture = W::FlushFuture
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
fn is_write_vectored(&self) -> bool
[src]
fn flush(&'a mut self) -> Self::FlushFuture
[src]
impl<'a, W: AsyncWriteWith<'a> + ?Sized> AsyncWriteWith<'a> for Box<W>
[src]
type WriteFuture = W::WriteFuture
type WriteVectoredFuture = W::WriteVectoredFuture
type FlushFuture = W::FlushFuture
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
fn is_write_vectored(&self) -> bool
[src]
fn flush(&'a mut self) -> Self::FlushFuture
[src]
impl<'a> AsyncWriteWith<'a> for Sink
[src]
type WriteFuture = Ready<Result<usize>>
type WriteVectoredFuture = Ready<Result<usize>>
type FlushFuture = Ready<Result<()>>
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
fn is_write_vectored(&self) -> bool
[src]
fn flush(&'a mut self) -> Self::FlushFuture
[src]
impl<'a> AsyncWriteWith<'a> for &Sink
[src]
type WriteFuture = Ready<Result<usize>>
type WriteVectoredFuture = Ready<Result<usize>>
type FlushFuture = Ready<Result<()>>
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
fn is_write_vectored(&self) -> bool
[src]
fn flush(&'a mut self) -> Self::FlushFuture
[src]
impl<'a, 's> AsyncWriteWith<'a> for &'s mut [u8]
[src]
type WriteFuture = WriteSlice<'a, 's>
type WriteVectoredFuture = WriteVectoredSlice<'a, 's>
type FlushFuture = Ready<Result<()>>
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
fn is_write_vectored(&self) -> bool
[src]
fn flush(&'a mut self) -> Self::FlushFuture
[src]
impl<'a> AsyncWriteWith<'a> for Vec<u8>
[src]
type WriteFuture = WriteVec<'a>
type WriteVectoredFuture = WriteVectoredVec<'a>
type FlushFuture = Ready<Result<()>>
fn write(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture
[src]
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> Self::WriteVectoredFuture