mealy/
lib.rs

1//! Docs pending. Sorry.
2
3#![no_std]
4
5pub mod timeout;
6
7pub trait MealyAutomaton: Sized {
8    type Input;
9    type Output;
10
11    fn transition(self, input: Self::Input) -> (Self, Self::Output);
12
13    #[inline]
14    fn failed(&self) -> bool {
15        false
16    }
17
18    #[inline]
19    fn done(&self) -> bool {
20        false
21    }
22
23    #[inline]
24    fn halted(&self) -> bool {
25        self.failed() || self.done()
26    }
27}