How to go about writing a async-runtime-agnostic no_std-friendly library

⚓ Rust    📅 2026-07-07    👤 surdeus    👁️ 1      

surdeus

i wasn't aware of the status quo of async/await wrt writing my own library up until now. i'm writing a library for learning, an rtsp server framework, similar to hyper. in that goal, i'd like to be as agnostic as possible wrt the choice of the async runtime the user chooses. i also want to not depend on libstd for helping embedded devs utilize my work, as to not waste human-beings' precious time

since std::io::Error in core is not stabilized yet (moved to core very recently), i don't think there are any libraries with supports for no_std akin to futures allowing me to utilize a set of standardized traits (for Read/Write-like functionality) thus. futures-io would be very nice to have since it is supposed to be the standard way to go about this, but sadly it does not support no_std. so i was thinking if the most sensible way to go about this is to use embassy-io-async? it appears to support adapts for futures (if another library wants to utilize it without not caring about no_std) and tokio (if the application author all together does care about no_std)?

i'm inexperienced in this regard, so i'd highly appreciate experienced library author's/user's opinions on the matter. my goal is to use standardized traits common in the ecosystem and be no_std friendly as much as possible (maybe i'd even have an std feature and use heapless when that's not available)

if there are people with experience with the nightly std::io::Error in core feature, i'd like to hear their experience as well

happy hacking!

1 post - 1 participant

Read full topic

🏷️ Rust_feed