Trait AsyncPipe

Source
pub trait AsyncPipe<T> {
    // Required methods
    fn send(&mut self, val: T) -> impl Future<Output = Result<()>>;
    fn recv(&mut self) -> impl Future<Output = Result<T>>;
}
Expand description

Simple communication channel to send/recv objects over an async stream.

Required Methods§

Source

fn send(&mut self, val: T) -> impl Future<Output = Result<()>>

Source

fn recv(&mut self) -> impl Future<Output = Result<T>>

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.

Implementations on Foreign Types§

Source§

impl<T: Send + Sync + 'static> AsyncPipe<T> for (UnboundedSender<T>, UnboundedReceiver<T>)

Source§

async fn send(&mut self, val: T) -> Result<()>

Source§

async fn recv(&mut self) -> Result<T>

Implementors§