pipecircuit 0.0.21

Correct. Robust. Fast. Portable. Pick four.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use pipecircuit::{Inline, InstalledPipe, Pipe, StateMachine, StepInputOf};
struct Protocol;
impl Pipe for Protocol {
    type In<'message> = Input;
    type Out<'message> = u8;
}
struct Implementation;
impl StateMachine for Implementation {}
struct Input;
impl StepInputOf<Implementation> for Input {
    type Outcome = u16;
    fn step(self, _: &mut Implementation) -> u16 { 0 }
}
fn main() {
    let mut installed = InstalledPipe::<Protocol, _>::new(Inline::for_pipe(Implementation));
    installed.send(Input);
}