Skip to main content

EventHandler

Trait EventHandler 

Source
pub trait EventHandler<T>: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        payload: T,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

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

Implementors§

Source§

impl<T, F, Fut> EventHandler<T> for F
where T: Send + 'static, F: Fn(T) -> Fut + Send + Sync, Fut: Future<Output = Result<()>> + Send,