Skip to main content

CommandDispatcher

Trait CommandDispatcher 

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

Dispatches one concrete command type while preserving its output type.

Every CommandHandler<C> implements this port automatically. It exists so application boundaries can use dispatch terminology without introducing a runtime service locator or erasing message and output types.

Required Methods§

Source

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

Dispatches the command to its typed handler or pipeline.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<C, H> CommandDispatcher<C> for H
where C: Command, H: CommandHandler<C> + ?Sized,