pub trait Machine<State> { fn update(&self, state: &mut State) -> bool; fn on_enter(&self, _: &mut State) -> bool { ... } fn on_exit(&self, _: &mut State) -> bool { ... } }