Skip to main content

CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler<C>: Send + Sync
where C: Command,
{ // Required method fn command(&self, command: C) -> BoxFuture<'_, SoapResult<C::Output>>; }
Expand description

Handles one concrete command type.

The method is named command to keep execute reserved for crate::UseCase. A command handler may itself contain application logic, delegate to a use case, or be implemented by a native adapter for a named infrastructure operation.

Required Methods§

Source

fn command(&self, command: C) -> BoxFuture<'_, SoapResult<C::Output>>

Handles the command.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<C> CommandHandler<C> for CommandPipeline<C>
where C: Command + 'static,