pipecircuit 0.0.23

Correct. Robust. Fast. Portable. Pick four.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}