Skip to main content

CommandEventHandler

Trait CommandEventHandler 

Source
pub trait CommandEventHandler {
    type State: Debug + Clone + Send + Sync + 'static;
    type Error: From<Error> + Clone + Debug + Send + Sync + 'static;

    // Required method
    fn get_prefix<'life0, 'async_trait>(
        &'life0 self,
        context: Context<Self::Error, Self::State>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn command<'life0, 'async_trait>(
        &'life0 self,
        context: Context<Self::Error, Self::State>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn no_command<'life0, 'async_trait>(
        &'life0 self,
        context: Context<Self::Error, Self::State>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn after_command<'life0, 'async_trait>(
        &'life0 self,
        context: Context<Self::Error, Self::State>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn error<'life0, 'async_trait>(
        &'life0 self,
        context: Context<Self::Error, Self::State>,
        error: Self::Error,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Associated Types§

Source

type State: Debug + Clone + Send + Sync + 'static

Source

type Error: From<Error> + Clone + Debug + Send + Sync + 'static

Required Methods§

Source

fn get_prefix<'life0, 'async_trait>( &'life0 self, context: Context<Self::Error, Self::State>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn command<'life0, 'async_trait>( &'life0 self, context: Context<Self::Error, Self::State>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn no_command<'life0, 'async_trait>( &'life0 self, context: Context<Self::Error, Self::State>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn after_command<'life0, 'async_trait>( &'life0 self, context: Context<Self::Error, Self::State>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn error<'life0, 'async_trait>( &'life0 self, context: Context<Self::Error, Self::State>, error: Self::Error, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§