FromEvent

Trait FromEvent 

Source
pub trait FromEvent {
    // Required method
    fn from_event<'async_trait>(
        context: BotContext,
        event: BotEvent,
    ) -> Pin<Box<dyn Future<Output = Option<Self>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
}
Expand description

Extractor trait for extracting information from BotEvent and BotContext.

Required Methods§

Source

fn from_event<'async_trait>( context: BotContext, event: BotEvent, ) -> Pin<Box<dyn Future<Output = Option<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Implementations on Foreign Types§

Source§

impl<T> FromEvent for Option<T>
where T: FromEvent,

Source§

fn from_event<'async_trait>( context: BotContext, event: BotEvent, ) -> Pin<Box<dyn Future<Output = Option<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Implementors§