pub trait StateMachine: Sized {
#[must_use = "state-machine outcomes must be handled"]
#[inline]
fn step<Input>(&mut self, input: Input) -> Input::Outcome
where
Input: StepInputOf<Self>,
{
input.step(self)
}
}
pub trait StepInputOf<Machine: StateMachine> {
type Outcome;
#[must_use = "step outcomes must be handled"]
fn step(self, state_machine: &mut Machine) -> Self::Outcome;
}