Skip to main content

CommandDispatcher

Trait CommandDispatcher 

Source
pub trait CommandDispatcher: Send + Sync {
    // Required method
    fn dispatch<'life0, 'async_trait, C>(
        &'life0 self,
        command: C,
    ) -> Pin<Box<dyn Future<Output = Result<C::Result, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where C: 'async_trait + Command,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Command dispatcher for routing commands to their handlers.

Provides a central point for command execution with optional middleware support (logging, validation, etc.).

Required Methods§

Source

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

Dispatch a command to its handler.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§