[−][src]Trait futures_io::AsyncWrite
Write bytes asynchronously.
This trait is analogous to the std::io::Write
trait, but integrates
with the asynchronous task system. In particular, the poll_write
method, unlike Write::write
, will automatically queue the current task
for wakeup and return if data is not yet available, rather than blocking
the calling thread.
Required methods
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[+]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[+]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[+]
Provided methods
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[+]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
Implementations on Foreign Types
impl<T: ?Sized + AsyncWrite + Unpin> AsyncWrite for Box<T>
[src][−]
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
impl<T: ?Sized + AsyncWrite + Unpin, '_> AsyncWrite for &'_ mut T
[src][−]
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
impl<P> AsyncWrite for Pin<P> where
P: DerefMut + Unpin,
P::Target: AsyncWrite,
[src][−]
P: DerefMut + Unpin,
P::Target: AsyncWrite,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
impl<T: AsMut<[u8]> + Unpin> AsyncWrite for Cursor<T>
[src][−]
fn poll_write(
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, _: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
impl AsyncWrite for Vec<u8>
[src][−]
fn poll_write(
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, _: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
impl AsyncWrite for Sink
[src][−]
fn poll_write(
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, _: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_vectored_write(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &[&IoVec]
) -> Poll<Result<usize>>