pub trait StateComputation<C, S, E> {
    // Required method
    fn compute_new_state(&self, current_state: Option<S>, command: &C) -> S;
}
Expand description

Formalizes the State Computation algorithm / state-stored system for the decider to handle commands based on the current state, and produce new state.

Required Methods§

source

fn compute_new_state(&self, current_state: Option<S>, command: &C) -> S

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

Implementors§

source§

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

source§

impl<C, S, E, Repository, Decider, Version, Error> StateComputation<C, S, E> for StateStoredAggregate<C, S, E, Repository, Decider, Version, Error>
where Repository: StateRepository<C, S, Version, Error>, Decider: StateComputation<C, S, E>,