pub trait AsyncFrameWrite: Send + Sync + Unpin {
    // Required method
    fn poll_write(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        bufs: &[IoSlice<'_>]
    ) -> Poll<Result<usize>>;

    // Provided methods
    fn poll_start_write(
        self: Pin<&mut Self>,
        _cx: &mut Context<'_>,
        _frame_size: usize
    ) -> Poll<Result<()>> { ... }
    fn poll_end_write(
        self: Pin<&mut Self>,
        _cx: &mut Context<'_>
    ) -> Poll<Result<()>> { ... }
    fn poll_flush(
        self: Pin<&mut Self>,
        _cx: &mut Context<'_>
    ) -> Poll<Result<()>> { ... }
    fn poll_shutdown(
        self: Pin<&mut Self>,
        _cx: &mut Context<'_>
    ) -> Poll<Result<()>> { ... }
}
Expand description

A message writer trait, which is used to write message to the underlying transport layer.

Required Methods§

source

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

Called until flushing all message

Provided Methods§

source

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

Called before writing a message

source

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

Called after writing single message

source

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

Flush the underlying transport layer.

source

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

Shutdown the underlying transport layer.

Implementors§