[−][src]Trait cqrs::Aggregate
A projected state built from a series of events.
Required methods
fn aggregate_type() -> &'static str
A static string representing the type of the aggregate.
Note: This should effectively be a constant value, and should never change.
Provided methods
fn apply<E>(&mut self, event: E) where
E: AggregateEvent<Self>,
E: AggregateEvent<Self>,
Consumes the event, applying its effects to the aggregate.
fn execute<C>(
&self,
command: C
) -> Result<<C as AggregateCommand<Self>>::Events, <C as AggregateCommand<Self>>::Error> where
C: AggregateCommand<Self>,
&self,
command: C
) -> Result<<C as AggregateCommand<Self>>::Events, <C as AggregateCommand<Self>>::Error> where
C: AggregateCommand<Self>,
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.