Trait polkadot_node_subsystem::gen::futures::prelude::AsyncWrite
source · pub trait AsyncWrite {
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>;
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>;
fn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>;
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>> { ... }
}
Expand description
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 the writer cannot take more data, rather than blocking
the calling thread.
Required Methods§
sourcefn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
Attempt to write bytes from buf
into the object.
On success, returns Poll::Ready(Ok(num_bytes_written))
.
If the object is not ready for writing, the method returns
Poll::Pending
and arranges for the current task (via
cx.waker().wake_by_ref()
) to receive a notification when the object becomes
writable or is closed.
Implementation
This function may not return errors of kind WouldBlock
or
Interrupted
. Implementations must convert WouldBlock
into
Poll::Pending
and either internally retry or convert
Interrupted
into another error kind.
poll_write
must try to make progress by flushing the underlying object if
that is the only way the underlying object can become writable again.
sourcefn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach their destination.
On success, returns Poll::Ready(Ok(()))
.
If flushing cannot immediately complete, this method returns
Poll::Pending
and arranges for the current task (via
cx.waker().wake_by_ref()
) to receive a notification when the object can make
progress towards flushing.
Implementation
This function may not return errors of kind WouldBlock
or
Interrupted
. Implementations must convert WouldBlock
into
Poll::Pending
and either internally retry or convert
Interrupted
into another error kind.
It only makes sense to do anything here if you actually buffer data.
sourcefn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to close the object.
On success, returns Poll::Ready(Ok(()))
.
If closing cannot immediately complete, this function returns
Poll::Pending
and arranges for the current task (via
cx.waker().wake_by_ref()
) to receive a notification when the object can make
progress towards closing.
Implementation
This function may not return errors of kind WouldBlock
or
Interrupted
. Implementations must convert WouldBlock
into
Poll::Pending
and either internally retry or convert
Interrupted
into another error kind.
Provided Methods§
sourcefn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
Attempt to write bytes from bufs
into the object using vectored
IO operations.
This method is similar to poll_write
, but allows data from multiple buffers to be written
using a single operation.
On success, returns Poll::Ready(Ok(num_bytes_written))
.
If the object is not ready for writing, the method returns
Poll::Pending
and arranges for the current task (via
cx.waker().wake_by_ref()
) to receive a notification when the object becomes
writable or is closed.
By default, this method delegates to using poll_write
on the first
nonempty buffer in bufs
, or an empty one if none exists. Objects which
support vectored IO should override this method.
Implementation
This function may not return errors of kind WouldBlock
or
Interrupted
. Implementations must convert WouldBlock
into
Poll::Pending
and either internally retry or convert
Interrupted
into another error kind.
Implementations on Foreign Types§
source§impl<T> AsyncWrite for &mut Twhere
T: AsyncWrite + Unpin + ?Sized,
impl<T> AsyncWrite for &mut Twhere
T: AsyncWrite + Unpin + ?Sized,
fn poll_write(
self: Pin<&mut &mut T>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut &mut T>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut &mut T>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut &mut T>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Vec<u8, Global>
impl AsyncWrite for Vec<u8, Global>
fn poll_write(
self: Pin<&mut Vec<u8, Global>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Vec<u8, Global>>,
_: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Vec<u8, Global>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Vec<u8, Global>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for Box<T, Global>where
T: AsyncWrite + Unpin + ?Sized,
impl<T> AsyncWrite for Box<T, Global>where
T: AsyncWrite + Unpin + ?Sized,
fn poll_write(
self: Pin<&mut Box<T, Global>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Box<T, Global>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Box<T, Global>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Box<T, Global>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<TInner> AsyncWrite for BandwidthConnecLogging<TInner>where
TInner: AsyncWrite,
impl<TInner> AsyncWrite for BandwidthConnecLogging<TInner>where
TInner: AsyncWrite,
fn poll_write(
self: Pin<&mut BandwidthConnecLogging<TInner>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut BandwidthConnecLogging<TInner>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut BandwidthConnecLogging<TInner>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut BandwidthConnecLogging<TInner>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for DummyStream
impl AsyncWrite for DummyStream
fn poll_write(
self: Pin<&mut DummyStream>,
_: &mut Context<'_>,
_: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut DummyStream>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut DummyStream>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<A, B> AsyncWrite for EitherOutput<A, B>where
A: AsyncWrite,
B: AsyncWrite,
impl<A, B> AsyncWrite for EitherOutput<A, B>where
A: AsyncWrite,
B: AsyncWrite,
fn poll_write(
self: Pin<&mut EitherOutput<A, B>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut EitherOutput<A, B>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut EitherOutput<A, B>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut EitherOutput<A, B>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for SubstreamBox
impl AsyncWrite for SubstreamBox
fn poll_write(
self: Pin<&mut SubstreamBox>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut SubstreamBox>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut SubstreamBox>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut SubstreamBox>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<S> AsyncWrite for RwStreamSink<S>where
S: TryStream + Sink<<S as TryStream>::Ok, Error = Error>,
<S as TryStream>::Ok: for<'r> From<&'r [u8]>,
impl<S> AsyncWrite for RwStreamSink<S>where
S: TryStream + Sink<<S as TryStream>::Ok, Error = Error>,
<S as TryStream>::Ok: for<'r> From<&'r [u8]>,
fn poll_write(
self: Pin<&mut RwStreamSink<S>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut RwStreamSink<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut RwStreamSink<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<TInner> AsyncWrite for Negotiated<TInner>where
TInner: AsyncWrite + AsyncRead + Unpin,
impl<TInner> AsyncWrite for Negotiated<TInner>where
TInner: AsyncWrite + AsyncRead + Unpin,
fn poll_write(
self: Pin<&mut Negotiated<TInner>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Negotiated<TInner>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Negotiated<TInner>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_write_vectored(
self: Pin<&mut Negotiated<TInner>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
source§impl<S> AsyncWrite for DeflateOutput<S>where
S: AsyncWrite + Unpin,
impl<S> AsyncWrite for DeflateOutput<S>where
S: AsyncWrite + Unpin,
fn poll_write(
self: Pin<&mut DeflateOutput<S>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut DeflateOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut DeflateOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Stderr
impl AsyncWrite for Stderr
source§impl AsyncWrite for Cursor<Vec<u8, Global>>
impl AsyncWrite for Cursor<Vec<u8, Global>>
fn poll_write(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_close(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Cursor<&mut Vec<u8, Global>>
impl AsyncWrite for Cursor<&mut Vec<u8, Global>>
fn poll_write(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_close(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for &UnixStream
impl AsyncWrite for &UnixStream
fn poll_write(
self: Pin<&mut &UnixStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut &UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut &UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Sink
impl AsyncWrite for Sink
source§impl AsyncWrite for TcpStream
impl AsyncWrite for TcpStream
fn poll_write(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for &File
impl AsyncWrite for &File
source§impl AsyncWrite for UnixStream
impl AsyncWrite for UnixStream
fn poll_write(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Stdout
impl AsyncWrite for Stdout
source§impl AsyncWrite for File
impl AsyncWrite for File
source§impl AsyncWrite for &TcpStream
impl AsyncWrite for &TcpStream
fn poll_write(
self: Pin<&mut &TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut &TcpStream>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut &TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut &TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<W> AsyncWrite for BufWriter<W>where
W: AsyncWrite,
impl<W> AsyncWrite for BufWriter<W>where
W: AsyncWrite,
fn poll_write(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Cursor<&mut [u8]>
impl AsyncWrite for Cursor<&mut [u8]>
fn poll_write(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Cursor<&mut [u8]>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Cursor<Vec<u8, Global>>
impl AsyncWrite for Cursor<Vec<u8, Global>>
fn poll_write(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_close(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut Cursor<Vec<u8, Global>>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Cursor<&mut [u8]>
impl AsyncWrite for Cursor<&mut [u8]>
fn poll_write(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Cursor<&mut [u8]>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Cursor<&mut [u8]>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Cursor<&mut Vec<u8, Global>>
impl AsyncWrite for Cursor<&mut Vec<u8, Global>>
fn poll_write(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_close(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut Cursor<&mut Vec<u8, Global>>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for WriteHalf<T>where
T: AsyncWrite + Unpin,
impl<T> AsyncWrite for WriteHalf<T>where
T: AsyncWrite + Unpin,
fn poll_write(
self: Pin<&mut WriteHalf<T>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut WriteHalf<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut WriteHalf<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<W> AsyncWrite for BufWriter<W>where
W: AsyncWrite,
impl<W> AsyncWrite for BufWriter<W>where
W: AsyncWrite,
fn poll_write(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut BufWriter<W>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<R> AsyncWrite for BufReader<R>where
R: AsyncWrite,
impl<R> AsyncWrite for BufReader<R>where
R: AsyncWrite,
fn poll_write(
self: Pin<&mut BufReader<R>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut BufReader<R>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut BufReader<R>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for AssertAsync<T>where
T: Write,
impl<T> AsyncWrite for AssertAsync<T>where
T: Write,
fn poll_write(
self: Pin<&mut AssertAsync<T>>,
_: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut AssertAsync<T>>,
_: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut AssertAsync<T>>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut AssertAsync<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for Sink
impl AsyncWrite for Sink
source§impl AsyncWrite for ChildStdin
impl AsyncWrite for ChildStdin
fn poll_write(
self: Pin<&mut ChildStdin>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut ChildStdin>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut ChildStdin>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for &Async<T>where
&'a T: for<'a> Write,
impl<T> AsyncWrite for &Async<T>where
&'a T: for<'a> Write,
fn poll_write(
self: Pin<&mut &Async<T>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut &Async<T>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut &Async<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut &Async<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for Async<T>where
T: Write,
impl<T> AsyncWrite for Async<T>where
T: Write,
fn poll_write(
self: Pin<&mut Async<T>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored(
self: Pin<&mut Async<T>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Async<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Async<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for Unblock<T>where
T: 'static + Write + Send,
impl<T> AsyncWrite for Unblock<T>where
T: 'static + Write + Send,
fn poll_write(
self: Pin<&mut Unblock<T>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Unblock<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Unblock<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<C> AsyncWrite for Substream<C>where
C: AsyncRead + AsyncWrite + Unpin,
impl<C> AsyncWrite for Substream<C>where
C: AsyncRead + AsyncWrite + Unpin,
fn poll_write(
self: Pin<&mut Substream<C>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Substream<C>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Substream<C>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<T> AsyncWrite for NoiseOutput<T>where
T: AsyncWrite + Unpin,
impl<T> AsyncWrite for NoiseOutput<T>where
T: AsyncWrite + Unpin,
fn poll_write(
self: Pin<&mut NoiseOutput<T>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut NoiseOutput<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut NoiseOutput<T>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<S> AsyncWrite for PlainTextOutput<S>where
S: AsyncRead + AsyncWrite + Unpin,
impl<S> AsyncWrite for PlainTextOutput<S>where
S: AsyncRead + AsyncWrite + Unpin,
fn poll_write(
self: Pin<&mut PlainTextOutput<S>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut PlainTextOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut PlainTextOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<S> AsyncWrite for PnetOutput<S>where
S: AsyncRead + AsyncWrite,
impl<S> AsyncWrite for PnetOutput<S>where
S: AsyncRead + AsyncWrite,
fn poll_write(
self: Pin<&mut PnetOutput<S>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut PnetOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut PnetOutput<S>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl AsyncWrite for RelayedConnection
impl AsyncWrite for RelayedConnection
fn poll_write(
self: Pin<&mut RelayedConnection>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut RelayedConnection>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut RelayedConnection>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_write_vectored(
self: Pin<&mut RelayedConnection>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
source§impl AsyncWrite for Connection
impl AsyncWrite for Connection
fn poll_write(
self: Pin<&mut Connection>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_flush(
self: Pin<&mut Connection>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut Connection>,
_: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<IO> AsyncWrite for TlsStream<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
impl<IO> AsyncWrite for TlsStream<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
source§fn poll_write(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
Note: that it does not guarantee the final data to be sent.
To be cautious, you must manually call flush
.
fn poll_flush(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_close(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
source§impl<IO> AsyncWrite for TlsStream<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
impl<IO> AsyncWrite for TlsStream<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
source§fn poll_write(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write(
self: Pin<&mut TlsStream<IO>>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
Note: that it does not guarantee the final data to be sent.
To be cautious, you must manually call flush
.