pub trait Actor<C: Cause, E: Effect, Err: Error> {
type Id;
type Version;
// Required methods
fn handle(&self, cause: C) -> Result<Vec<E>, Err>;
fn apply(&mut self, effects: Vec<E>) -> Result<(), Err>;
}
Expand description
Entity that handles Causes
producing one or more Effects
upon success.
Implemented for Root Aggregates
or Aggregates
in Event Sourcing
.