Skip to main content

PollWrite

Trait PollWrite 

Source
pub trait PollWrite {
    // Required methods
    fn poll_write(
        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<()>>;
}
Expand description

Minimal poll-based write trait used by Foctet runtime adapters.

Required Methods§

Source

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>

Attempts to write bytes from buf.

Source

fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

Flushes pending writes.

Source

fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

Closes the writer side.

Implementors§

Source§

impl<T> PollWrite for FuturesIo<T>
where T: AsyncWrite + Unpin,

Available on crate feature runtime-futures only.
Source§

impl<T> PollWrite for TokioIo<T>
where T: AsyncWrite + Unpin,

Available on crate feature runtime-tokio only.