zlacker

[return to "The bane of my existence: Supporting both async and sync code in Rust"]
1. the__a+kf[view] [source] 2024-01-19 23:23:07
>>lukast+(OP)
I run into this sometimes for `std` rust libraries; generally involving networking. Not directly mentioned in the article, but I prefer to wrap a `block_on` in a thread, and use `std::sync::mpsc`, or as required, to manage state.

On embedded, I make my own libraries for everything; the open-source community has gone full-in on either Async, or an typestate/generic API. I don't see this changing any time soon, but maybe later down the road. I feel like the only one who doesn't like either.

◧◩
2. MrBudd+201[view] [source] 2024-01-20 08:25:42
>>the__a+kf
Nah same, I find the typestate pattern to be overprotective against bugs that usually get caught during development, and async Rust is just a killjoy overall.
[go to top]