pub trait StateBehavior {
type State: Clone + Copy + PartialEq + Default;
type Event: Clone + Copy + PartialEq;
type Context: Default;
// Required method
fn handle(
&self,
event: &Self::Event,
_context: &mut Self::Context,
) -> Option<Self::State>;
// Provided methods
fn enter(&self, _context: &mut Self::Context) { ... }
fn exit(&self, _context: &mut Self::Context) { ... }
}Expand description
Trait for the state behavior.