Skip to main content

EventComputation

Trait EventComputation 

Source
pub trait EventComputation<C, S, E, Error = ()> {
    // Required method
    fn compute_new_events(
        &self,
        current_events: &[E],
        command: &C,
    ) -> Result<Vec<E>, Error>;
}
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, ) -> Result<Vec<E>, Error>

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C, S, E, Error> EventComputation<C, S, E, Error> for Decider<'_, C, S, E, Error>

Source§

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