io: `ErrorType` could be split into `Read::Error`, `Write::Error` and `Seek::Error`.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- embedded-iot
Research direction
Start by locating the definitions and implementations of the Read, Write, Seek, BufRead, ReadReady, and WriteReady traits. Review how ErrorType is currently shared and identify the existing tests or examples covering these traits. Done means the proposed error separation and supertrait relationships are agreed upon and consistently represented in the project.
Written by the indexing model from the issue text.
Description
While I Implemented Read and Write on a custom type, I noticed that the errors that can happen during Read are not always the same as the errors that happen during write.
For example, if you implement a Cursor type like the one in std::io, read cannot fail, while write can fail if the storage is full.
I propose to remove ErrorType and simply add an associated type Error to Read, Write and Seek. We don't have to add one to BufRead because it is a super trait of Read. We could make ReadReady and WriteReady super traits of Read and Write respectively.
I think this makes the code more flexible and idiomatic. This also looks more consistent with the approach of mebedded-hal of favoring fine-grained errors.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 283
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 30/100
rust-embedded/embedded-hal#747 · 5 comments · 1 reaction ·
-
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 ·
All issues in rust-embedded/embedded-hal
Similar issues
-
C-bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rust-lang/rust-analyzer#23501 ·
Maintainers usually reply within 1 day
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusPossibly taken A pull request linked to this issue is open or already merged. Openbug P2 ready for work T-security T-transport
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/rust-sdk#1339 ·
Maintainers usually reply within 3 days
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seedPossibly taken @Kshot3000 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 91/100
ergoplatform/sigma-rust#976 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug]: Web chat input doesn't regain focus after a reply finishesPossibly taken @GaijinSystems claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zeroclaw-labs/zeroclaw#11658 ·
Maintainers usually reply within 2 days