You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello and welcome! Are you familiar with APIs for sharing implementations between sync and async? I'd like to reuse tests and impls where possible to avoid duplication.
Taking a deeper look at the problem here, which boils down to me wanting to reuse the async implementation in any sync APIs, makes me realize there's no good way to do this currently. There's an initiative to make this possible, but I suspect it's not coming to stable Rust soon.
One alternative is to have callers use something like async_std::task::block_on. Have you tried something like this with linux-embedded-hal?
There's also the possibility to add async support into linux-embedded-hal for this crate's needed APIs. There's precedence there with the async DelayNs being supported in rust-embedded/linux-embedded-hal#109, though this only targets the tokio runtime. Is there a chance you'd be able to use an async runtime on Linux in your project?
In the meantime, I'll take a closer look at your PR. Some repeated implementations on a small crate like this isn't the end of the world.
Nice library! It would be possible to have a sync API ?
I'm trying to use it with linux_embedded_hal
The text was updated successfully, but these errors were encountered: