pub trait AsyncFrameWrite: Send + 'static {
    // Required method
    fn poll_write(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        buf: &mut FrameReader<'_>
    ) -> Poll<Result<()>>;

    // Provided methods
    fn begin_write_frame(self: Pin<&mut Self>, len: usize) -> Result<()> { ... }
    fn poll_flush(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>> { ... }
    fn poll_close(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>> { ... }
}

Required Methods§

source

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

Write a frame to the underlying transport. It can be called multiple times to write a single frame. In this case, the input buffer should be advanced accordingly.

Provided Methods§

source

fn begin_write_frame(self: Pin<&mut Self>, len: usize) -> Result<()>

Called before writing a frame. This can be used to deal with writing cancellation.

source

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

Flush the underlying transport.

source

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

Close the underlying transport.

Implementors§

source§

impl AsyncFrameWrite for InMemoryWriter

source§

impl<T> AsyncFrameWrite for Twhere T: AsyncWrite + Send + 'static,

Futures adaptor for [AsyncWriteFrame]