Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

io: `ErrorType` could be split into `Read::Error`, `Write::Error` and `Seek::Error`.

Aperta
#693 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
embedded-iot

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
2.7k
Fork
283
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-embedded/embedded-hal

Tutte le issue di rust-embedded/embedded-hal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.