pub trait Framework: Send + Sync {
// Required method
fn dispatch<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
event: FullEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
A trait for defining your own framework for serenity to use.
Should you implement this trait, or define a message
handler, depends on you. However, using
this will benefit you by abstracting the EventHandler
away.