Consider Replacing/Augmenting `embedded-io(-*)` with `alloc::io` and `futures-io`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Start by reviewing the proposed alloc::io and core::io implementations and the existing embedded-io, embedded-io-adapters, and embedded-io-async crates. Compare the proposal's MSRV, alloc, error-type, blocking, and async implications with the linked futures-io work. Done means establishing a maintainer-backed direction for replacement, augmentation, or continued use; no implementation files or tests are named.
Written by the indexing model from the issue text.
Description
Background
With rust-lang/rust#154046 implemented, nightly now has a full implementation of std::io available from alloc::io, and a partial implementation available from core::io. With that, other crates such as futures-io can gain no_std support, potentially making them viable in the embedded space.
Proposal
- Increase MSRV to whatever version contains a stabilized
alloc::io&core::io. - Directly use
core::ioand (where required)alloc::iofor synchronous I/O. - Use
futures-iofor asynchronous I/O. - Deprecate
embedded-io,embedded-io-adapters, andembedded-io-async.
Drawbacks
ReadandBufReadare currently only available fromalloc::io.embedded-ioprovides alternatives to those traits even without theallocfeature enabled, so using the standard library I/O traits would increase the need for downstream crates to enable theallocfeature.embedded-ioallows changing the error type used for I/O operations, whereas the standard library traits usecore::io::Errorexclusively.embedded-ioguarantees its trait implementations are blocking, deferring non-blocking support toReadReadyandWriteReady. These traits could remain, orembedded-halcould move towards the standard library approach of mixed non-/blocking.
Benefits
- Three fewer crates to maintain.
- Standardised I/O interface which would allow non-embedded crates to more easily be used in an embedded context (e.g.,
flate2) - Potentially reduced friction for users starting in embedded Rust by avoiding divergence (as noted in #694, #686, and #648)
Notes
- I'm one of the contributors working on
alloc_ioandcore_io. I'm opening this issue to gauge interest in a standard library implementation ofno_stdI/O, and whether it may be suitable for stabilization.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 282
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-embedded/embedded-hal
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-embedded/embedded-hal#742 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rust-embedded/embedded-hal#746 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-embedded/embedded-hal#745 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
rust-embedded/embedded-hal#744 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rust-embedded/embedded-hal#741 · 1 reaction ·
All issues in rust-embedded/embedded-hal
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100