[][src]Trait cqrs_core::AggregateCommand

pub trait AggregateCommand<A: Aggregate> {
type Event: AggregateEvent<A>;
type Events: Events<ProducedEvent<A, Self>>;
type Error: CqrsError;
    fn execute_on(self, aggregate: &A) -> Result<Self::Events, Self::Error>;
}

A command that can be executed against an aggregate.

Associated Types

type Event: AggregateEvent<A>

The type of event that is produced by this command.

type Events: Events<ProducedEvent<A, Self>>

The type of the sequence of events generated when the command is executed successfully.

type Error: CqrsError

The error type.

Loading content...

Required methods

fn execute_on(self, aggregate: &A) -> Result<Self::Events, Self::Error>

Consumes a command, attempting to execute it against the aggregate. If the execution is successful, a sequence of events is generated, which can be applied to the aggregate.

Loading content...

Implementors

Loading content...