Generators are currently unstable, but the crate genawaiter[1] allows you to use them on stable.
We have used that crate at work to replace a very scary and verbose state machine (which was generating a lot more code via procedural macros) with a much more succinct version.
We have used that crate at work to replace a very scary and verbose state machine (which was generating a lot more code via procedural macros) with a much more succinct version.
[1]: https://docs.rs/genawaiter/0.2.2/genawaiter/