[][src]Trait lifeline::Receiver

pub trait Receiver<T> {
#[must_use]    pub fn recv<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

The receiver half of an asynchronous channel, which may be bounded/unbounded, mpsc/broadcast/oneshot, etc.

This trait provides a consistent interface for all async receivers, which makes your app code very robust to channel changes on the bus. It also allows impl Receiver<ExampleMessage> in your associated function signatures.

Required methods

#[must_use]pub fn recv<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Loading content...

Implementations on Foreign Types

impl<T> Receiver<T> for Receiver<T> where
    T: Debug + Send
[src]

impl<T> Receiver<T> for Receiver<T> where
    T: Clone + Debug + Send
[src]

impl<T> Receiver<T> for Receiver<T> where
    T: Clone + Debug + Send + Sync
[src]

Loading content...

Implementors

impl<T, R> Receiver<T> for LifelineReceiver<T, R> where
    T: Send + Debug,
    R: Send + Receiver<T>, 
[src]

impl<T: Clone + Default + Sync> Receiver<T> for BarrierReceiver<T>[src]

Loading content...