pub trait Command: Send + 'static {
type Event: Event + Event;
type Executor: CommandExecutor<Self> + EventApplier<Self::Event>;
type ExecutorRegistry: SystemService;
type CommandHandler: CommandHandler + Handler<Self, Self::Executor>;
// Required method
fn identifier(&self) -> String;
}
Expand description
Define a Command which can be dispatch
Required Associated Types§
sourcetype Executor: CommandExecutor<Self> + EventApplier<Self::Event>
type Executor: CommandExecutor<Self> + EventApplier<Self::Event>
The Executor that will execute the command and produce the events
Note that for now, onlu Aggregate can be used as Executor.
sourcetype ExecutorRegistry: SystemService
type ExecutorRegistry: SystemService
The registry where the command will be dispatched
type CommandHandler: CommandHandler + Handler<Self, Self::Executor>
Required Methods§
sourcefn identifier(&self) -> String
fn identifier(&self) -> String
Returns the identifier for this command.
The identifier is used to choose the right executor.