"All men are mortal, Socrates is a man, therefore Socrates is mortal."
Or, "Writing sans I/O APIs by abusing Rust's language features"
If you've ever looked into how Rust Futures work you've probably read at some point
that async/await
syntax de-sugars into a state machine. If you like to poke at
things to see what happens then you might also have wondered if this fact can be abused
to instead write other sorts of state machines like, oh I don't know, the state machines you
might need for implementing a sans I/O network protocol API.
Does this work? → Yes.
Does this constitute "crimes"? → Also yes.
Am I a little bit too happy with how this turned out? → Maybe...