quick_xml::de::from_reader
requires a BufRead
instead of just an std::io::Read
#716
Labels
quick_xml::de::from_reader
requires a BufRead
instead of just an std::io::Read
#716
Uh oh!
There was an error while loading. Please reload this page.
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 anyProtocol
functions.The text was updated successfully, but these errors were encountered: