pub trait FsmState:
Send
+ Sync
+ 'static {
// Required methods
fn as_key(&self) -> String;
fn from_key(key: &str) -> Option<Self>
where Self: Sized;
}Expand description
A type that can be used as an FSM state.
Implement this trait on an enum to use it with StateContext and
the FSM dispatcher.
In practice you will derive this via #[derive(FsmState)]:
#[derive(Clone, Debug, PartialEq)]
enum CheckoutState {
Cart,
Address,
Payment,
Confirmation,
}