Trait Receiver

Source
pub trait Receiver:
    Sync
    + Send
    + 'static {
    // Required method
    fn receive(&mut self) -> impl Future<Output = Result<Bytes, Error>> + Send;
}
Expand description

A trait for receiving messages.

Required Methods§

Source

fn receive(&mut self) -> impl Future<Output = Result<Bytes, Error>> + Send

Receive a message from the stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<St: Stream> Receiver for Receiver<St>