pub trait ViewStateComputation<E, S> {
// Required method
fn compute_new_state(&self, current_state: Option<S>, events: &[&E]) -> S;
}
Expand description
Formalizes the State Computation
algorithm for the view
to handle events based on the current state, and produce new state.
Required Methods§
Sourcefn compute_new_state(&self, current_state: Option<S>, events: &[&E]) -> S
fn compute_new_state(&self, current_state: Option<S>, events: &[&E]) -> S
Computes new state based on the current state and the events.