[][src]Trait serenity::framework::Framework

pub trait Framework: Send + Sync {
#[must_use]    fn dispatch<'life0, 'async_trait>(
        &'life0 self,
        __arg1: Context,
        __arg2: Message
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

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, and providing a reference to serenity's threadpool, so that you may run your commands in separate threads.

Required methods

#[must_use]fn dispatch<'life0, 'async_trait>(
    &'life0 self,
    __arg1: Context,
    __arg2: Message
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementations on Foreign Types

impl<F: ?Sized> Framework for Box<F> where
    F: Framework
[src]

impl<'a, F: ?Sized> Framework for &'a mut F where
    F: Framework
[src]

Loading content...

Implementors

impl Framework for StandardFramework[src]

Loading content...