`quick_xml::de::from_reader` requires a `BufRead` instead of just an `std::io::Read`

Aperta
#716 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by reading the quick_xml::de::from_reader implementation and the related discussion in issue #499 to determine why it requires BufRead. The issue asks whether support for std::io::Read is feasible and describes a stateless protocol use case; done would mean maintainers agree on the API direction and the reader requirement is addressed.

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

Descrizione

help wanted

I'm curious why this is the case. Does the implementation require buffering? If not, why not users worry about whether the read uses buffering? Similar thoughts as #499 here. Unless there's particular hesitance, would the maintainers be open to a PR allowing implementations which use unbuffered read?

EDIT: For the purposes of forthrightness I'll go ahead and explain the usecase that caused me to think about this: I have a trait Protocol whose implementers I would like to be stateless (i.e., the structs underlying implementers are just empty types to get to the functions). So I can't give implementers a buffer to manage, and I don't want to allocate extra memory every time I serialize a protocol message. Conversely, I don't want my API to assume consumers are using buffered reading, which may not be their preference for any number of reasons, and so I don't want the buffer to come as an argument to any Protocol functions.

Lingua principale
Rust
Stelle
1.6k
Fork
299
Merge medio
2g 4h
PR unite (30g)
9

Preparare l'ambiente

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 tafia/quick-xml

Tutte le issue di tafia/quick-xml

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.