Skip to main content

EventHandler

Trait EventHandler 

Source
pub trait EventHandler<E: Event>:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        ctx: HandlerCtx,
        event: E,
    ) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Processes a strongly typed event received from the event bus.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, ctx: HandlerCtx, event: E, ) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§