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§
Sourcefn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut FrameReader<'_>,
) -> Poll<Result<()>>
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§
Sourcefn begin_write_frame(self: Pin<&mut Self>, len: usize) -> Result<()>
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.
Implementors§
impl AsyncFrameWrite for InMemoryWriter
impl<T> AsyncFrameWrite for Twhere
T: AsyncWrite + Send + 'static,
Futures adaptor for [AsyncWriteFrame]