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. bpye+Rf[view] [source] 2024-01-19 23:26:39
>>the__a+kf
Do you have any open source embedded projects? I’m curious of the direction you’ve gone in.
◧◩◪
3. the__a+1g[view] [source] 2024-01-19 23:27:31
>>bpye+Rf
Here's one: https://github.com/David-OConnor/stm32-hal

Device IC code generally ends as files in my firmware directly.

[go to top]