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 { ... }
}Available on crate feature
framework only.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.
Required Methods§
Provided Methods§
Implementations on Foreign Types§
Source§impl<F> Framework for &mut F
impl<F> Framework for &mut F
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,
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,
Source§impl<F> Framework for Box<F>
impl<F> Framework for Box<F>
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,
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,
Implementors§
impl Framework for StandardFramework
Available on crate feature
standard_framework only.