pub trait Listener<T>: Send + Sync + 'static {
    // Required method
    fn handle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _: &'life1 Event<T>
    ) -> Pin<Box<dyn Future<Output = Result<(), ListenerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Event listener

Note: the struct which implements Listener need to be Send and Sync

Required Methods§

source

fn handle<'life0, 'life1, 'async_trait>( &'life0 self, _: &'life1 Event<T> ) -> Pin<Box<dyn Future<Output = Result<(), ListenerError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

handler callback to process event

Implementors§