pub trait StateComputation<C, S, E, Error = ()> {
// Required method
fn compute_new_state(
&self,
current_state: Option<S>,
command: &C,
) -> Result<S, Error>;
}
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§
Sourcefn compute_new_state(
&self,
current_state: Option<S>,
command: &C,
) -> Result<S, Error>
fn compute_new_state( &self, current_state: Option<S>, command: &C, ) -> Result<S, Error>
Computes new state based on the current state and the command.