pub trait FiniteStateMachine {
type State: Clone + Eq + 'static;
type Data: Clone + 'static;
type Msg: Send + 'static;
// Required methods
fn initial_state(&self) -> Self::State;
fn initial_data(&self) -> Self::Data;
fn transition(
&mut self,
current: &Self::State,
data: &Self::Data,
msg: Self::Msg,
) -> Option<FsmTransition<Self::State, Self::Data>>;
}Expand description
Simple trait-based FSM. Actors implementing this trait are driven by
ctx.become(...) inside their cell.