Skip to main content

AsyncWrite

Trait AsyncWrite 

Source
pub trait AsyncWrite {
    // 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_shutdown(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<()>>;

    // Provided methods
    fn poll_write_vectored(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        bufs: &[IoSlice<'_>],
    ) -> Poll<Result<usize>> { ... }
    fn is_write_vectored(&self) -> bool { ... }
}
Expand description

Async non-blocking write.

Required Methods§

Source

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

Attempt to write data from buf.

Source

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

Attempt to flush buffered data.

Source

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

Attempt to shutdown the writer.

Provided Methods§

Source

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>

Attempt to write data from multiple buffers (vectored I/O).

Source

fn is_write_vectored(&self) -> bool

Returns whether this writer has efficient vectored writes.

Implementations on Foreign Types§

Source§

impl AsyncWrite for Vec<u8>

Source§

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

Source§

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

Source§

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

Source§

impl AsyncWrite for Cursor<&mut [u8]>

Source§

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

Source§

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

Source§

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

Source§

impl AsyncWrite for Cursor<Box<[u8]>>

Source§

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

Source§

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

Source§

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

Source§

impl AsyncWrite for Cursor<Vec<u8>>

Source§

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

Source§

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

Source§

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

Source§

impl<W> AsyncWrite for &mut W
where W: AsyncWrite + Unpin + ?Sized,

Source§

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

Source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>

Source§

fn is_write_vectored(&self) -> bool

Source§

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

Source§

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

Source§

impl<W> AsyncWrite for Box<W>
where W: AsyncWrite + Unpin + ?Sized,

Source§

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

Source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>

Source§

fn is_write_vectored(&self) -> bool

Source§

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

Source§

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

Source§

impl<W, P> AsyncWrite for Pin<P>
where P: DerefMut<Target = W> + Unpin, W: AsyncWrite + Unpin + ?Sized,

Source§

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

Source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>

Source§

fn is_write_vectored(&self) -> bool

Source§

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

Source§

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

Implementors§

Source§

impl AsyncWrite for ClientIo

Source§

impl AsyncWrite for File

Source§

impl AsyncWrite for asupersync::net::tcp::split::OwnedWriteHalf

Source§

impl AsyncWrite for asupersync::net::tcp::split::WriteHalf<'_>

Source§

impl AsyncWrite for TcpStream

Source§

impl AsyncWrite for VirtualTcpStream

Source§

impl AsyncWrite for asupersync::net::unix::split::OwnedWriteHalf

Source§

impl AsyncWrite for asupersync::net::unix::split::WriteHalf<'_>

Source§

impl AsyncWrite for UnixStream

Source§

impl AsyncWrite for ChildStdin

Source§

impl<T> AsyncWrite for asupersync::io::WriteHalf<'_, T>
where T: AsyncWrite + Unpin,

Source§

impl<W: AsyncWrite + Unpin> AsyncWrite for asupersync::fs::BufWriter<W>

Source§

impl<W: AsyncWrite + Unpin> AsyncWrite for asupersync::io::BufWriter<W>