SubscriberFunc

Trait SubscriberFunc 

Source
pub trait SubscriberFunc<E: Event>: Send + Sync {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        event: Arc<E>,
        data: Arc<RwLock<E::Data>>,
    ) -> Pin<Box<dyn Future<Output = EventResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, event: Arc<E>, data: Arc<RwLock<E::Data>>, ) -> Pin<Box<dyn Future<Output = EventResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<T, E: Event + 'static, F> SubscriberFunc<E> for T
where T: Fn(Arc<E>, Arc<RwLock<E::Data>>) -> F + Send + Sync, F: Future<Output = EventResult> + Send,