Trait chekov::Command

source ·
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§

source

type Event: Event + Event

The Event that can be generated for this command

source

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.

source

type ExecutorRegistry: SystemService

The registry where the command will be dispatched

source

type CommandHandler: CommandHandler + Handler<Self, Self::Executor>

Required Methods§

source

fn identifier(&self) -> String

Returns the identifier for this command.

The identifier is used to choose the right executor.

Implementors§