Trait chekov::EventHandler

source ·
pub trait EventHandler: Clone + Sized + Unpin + 'static {
    // Required method
    fn handle_recorded_event<'life0, 'async_trait>(
        state: &'life0 mut Self,
        event: RecordedEvent
    ) -> Pin<Box<dyn Future<Output = Result<(), HandleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn builder(self) -> EventHandlerBuilder<Self> { ... }
    fn listen<A: Application>(
        &self,
        _ctx: &mut Context<EventHandlerInstance<A, Self>>
    ) { ... }
    fn started<A: Application>(
        &mut self,
        _ctx: &mut Context<EventHandlerInstance<A, Self>>
    )
       where Self: EventHandler { ... }
}
Expand description

Define a struct as an EventHandler

Required Methods§

source

fn handle_recorded_event<'life0, 'async_trait>( state: &'life0 mut Self, event: RecordedEvent ) -> Pin<Box<dyn Future<Output = Result<(), HandleError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

fn builder(self) -> EventHandlerBuilder<Self>

source

fn listen<A: Application>( &self, _ctx: &mut Context<EventHandlerInstance<A, Self>> )

source

fn started<A: Application>( &mut self, _ctx: &mut Context<EventHandlerInstance<A, Self>> )where Self: EventHandler,

Implementors§