pub trait CommandHandler<C: Command>: Send + Sync {
type Error: Error + Send + Sync;
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
command: C,
) -> Pin<Box<dyn Future<Output = Result<C::Result, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for executing commands.
Each command type should have exactly one handler. Handlers contain the business logic for processing commands.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".