Trait EventComputation

Source
pub trait EventComputation<C, S, E> {
    // Required method
    fn compute_new_events(&self, current_events: &[E], command: &C) -> Vec<E>;
}
Expand description

Formalizes the Event Computation algorithm / event sourced system for the decider to handle commands based on the current events, and produce new events.

Required Methods§

Source

fn compute_new_events(&self, current_events: &[E], command: &C) -> Vec<E>

Computes new events based on the current events and the command.

Implementors§

Source§

impl<'a, C, S, E> EventComputation<C, S, E> for Decider<'a, C, S, E>

Source§

impl<C, S, E, Repository, Decider, Version, Error> EventComputation<C, S, E> for EventSourcedAggregate<C, S, E, Repository, Decider, Version, Error>
where Repository: EventRepository<C, E, Version, Error>, Decider: EventComputation<C, S, E>,