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§
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§
impl<S: BotState> BotHandlerFn<S> for AuthHandler
impl<S: BotState> BotHandlerFn<S> for Handler<S>
Implement the BotHandlerFn trait for Handler.
impl<S: BotState> BotHandlerFn<S> for HandlerFn<S>
Implement the BotHandlerFn trait for HandlerFn.