CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler<C: Command, E: Event>: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        command: C,
    ) -> Pin<Box<dyn Future<Output = CommandResult<E>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature cqrs only.
Expand description

Command handler trait

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, command: C, ) -> Pin<Box<dyn Future<Output = CommandResult<E>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the command

Implementors§