Handler

Trait Handler 

Source
pub trait Handler<T: Sync> {
    // Required method
    fn handle<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        bot: &'life1 Bot,
        update: &'life2 Update,
        state: Option<&'life3 BotState<T>>,
    ) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Handles an incoming update
This trait should not be manually implemented, instead use the handler and command macros

Required Methods§

Source

fn handle<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bot: &'life1 Bot, update: &'life2 Update, state: Option<&'life3 BotState<T>>, ) -> Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Handles an incoming update

Implementors§