Skip to main content

EventSubscriber

Trait EventSubscriber 

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

    // Provided method
    fn recv_filtered<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        topic_prefix: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Event>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Subscriber that can filter and receive events.

Required Methods§

Source

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

Receive the next event.

Provided Methods§

Source

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

Receive the next event whose topic starts with the given prefix. Events that don’t match are silently skipped.

Implementors§