BotHandlerFn

Trait BotHandlerFn 

Source
pub trait BotHandlerFn<S: BotState>: Send + Sync {
    // Required method
    fn run<'life0, 'async_trait>(
        &'life0 self,
        event: Event,
        state: State<S>,
    ) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

BotHandlerFns are async functions that take an Event and a State and return an Action

Required Methods§

Source

fn run<'life0, 'async_trait>( &'life0 self, event: Event, state: State<S>, ) -> Pin<Box<dyn Future<Output = Result<Action, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<S: BotState> BotHandlerFn<S> for AuthHandler

Source§

impl<S: BotState> BotHandlerFn<S> for Handler<S>

Implement the BotHandlerFn trait for Handler.

Source§

impl<S: BotState> BotHandlerFn<S> for HandlerFn<S>

Implement the BotHandlerFn trait for HandlerFn.