Async #Rust is actually awesome! awesome

The last few days I've built a prototype(!) of a global "Hotkey" system e.g.:

Press & Hold LCtrl + Space
=> an async stream starts and only finishes if:
- another key is pressed or
- one of the Hotkeys is released

If it is not clear by now: this is a state-machine, which fits perfectly into Rust's #async model!

And the best part: This is actually the first time I've ever touched async #RustLang! Such a pleasant experience!

1/?

#AsyncRust

For this to work, I had to transform a sync callback with the keypress events (from device_query crate) to an async stream.
This can be done with a channel:
- use send (blocking-variant) from within the callback
- use async receiver in your stream impl

In the following post, I'll list some crates that have helped me achieve this...

2/?