Skip to main content

EventBus

Trait EventBus 

Source
pub trait EventBus: EventEmitter {
    // Provided method
    fn collected_events<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Event sink that supports emission and optional collection.

Every EventBus is an EventEmitter. Embedders that want to inspect emitted events override collected_events; production hosts inherit the no-op default.

Provided Methods§

Source

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

Return all collected events. Defaults to an empty Vec for buses that do not retain events.

Implementations on Foreign Types§

Source§

impl EventBus for InMemoryEventEmitter

Source§

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

Source§

impl<T: EventBus + ?Sized> EventBus for Arc<T>

Source§

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

Implementors§