Skip to main content

SendStreamUnframed

Trait SendStreamUnframed 

Source
pub trait SendStreamUnframed<B: Buf>: SendStream<B> {
    // Required method
    fn poll_send<D: Buf>(
        &mut self,
        cx: &mut Context<'_>,
        buf: &mut D,
    ) -> Poll<Result<usize, StreamErrorIncoming>>;
}
Expand description

Allows sending unframed pure bytes to a stream. Similar to AsyncWrite

Required Methods§

Source

fn poll_send<D: Buf>( &mut self, cx: &mut Context<'_>, buf: &mut D, ) -> Poll<Result<usize, StreamErrorIncoming>>

Attempts to write data into the stream.

Returns the number of bytes written. When buf is non-empty, an implementation that cannot currently make progress must return Poll::Pending and arrange to wake the task. Returning Poll::Ready(Ok(0)) means the stream cannot make progress.

buf is advanced by the number of bytes written.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§