EventReceiver

Trait EventReceiver 

Source
pub trait EventReceiver: Send + Sync {
    // Required method
    fn receive<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Event>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn receive_timeout<'life0, 'async_trait>(
        &'life0 mut self,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Event>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn is_active(&self) -> bool { ... }
}
Expand description

Event receiver trait for consuming events

Required Methods§

Source

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

Receive the next event

Provided Methods§

Source

fn receive_timeout<'life0, 'async_trait>( &'life0 mut self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<Option<Event>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive events with a timeout

Source

fn is_active(&self) -> bool

Check if the receiver is still active

Implementors§