Skip to main content

Rx

Trait Rx 

Source
pub trait Rx<M: RemoteMessage> {
    // Required methods
    fn recv<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<M, ChannelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn addr(&self) -> ChannelAddr;
    fn join<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
}
Expand description

The receive end of an M-typed channel.

Required Methods§

Source

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<M, ChannelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive the next message from the channel. If the channel returns an error it is considered broken and should be discarded.

Source

fn addr(&self) -> ChannelAddr

The channel address from which this Rx is receiving.

Source

fn join<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Gracefully shut down the channel receiver, flushing any pending acks before returning. Implementations must ensure all pending acks are sent before this method returns.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<M: RemoteMessage> Rx<M> for ChannelRx<M>

Source§

impl<M: RemoteMessage> Rx<M> for DuplexRx<M>