rt::io: Add Bytes iterator for Reader#8935
Closed
bluss wants to merge 2 commits intorust-lang:masterfrom
bluss:reader-bytes
Closed
rt::io: Add Bytes iterator for Reader#8935bluss wants to merge 2 commits intorust-lang:masterfrom bluss:reader-bytes
bluss wants to merge 2 commits intorust-lang:masterfrom
bluss:reader-bytes
Conversation
An iterator that simply calls `.read_bytes()` each iteration. I think choosing to own the Reader value and implementing Decorator to allow extracting it is the most generically useful. The Reader type variable can of course be some kind of reference type that implements Reader.
Contributor
Author
|
We could add further basic support for |
Contributor
|
Added an issue for buffering #8953 |
Contributor
|
Thanks! I'm glad you are continuing to push |
Contributor
Author
|
If you think it's ok I think |
Contributor
|
@anasazi This overlaps the work you are doing with iteration. |
bors
added a commit
that referenced
this pull request
Sep 4, 2013
An iterator that simply calls `.read_bytes()` each iteration. I think choosing to own the Reader value and implementing Decorator to allow extracting it is the most generically useful. The Reader type variable can of course be some kind of reference type that implements Reader. In the generic form the `Bytes` iterator is well behaved itself and does not read ahead. It performs abysmally on top of a FileStream, and much better if a buffering reader is inserted inbetween.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An iterator that simply calls
.read_bytes()each iteration.I think choosing to own the Reader value and implementing Decorator to
allow extracting it is the most generically useful. The Reader type
variable can of course be some kind of reference type that implements
Reader.
In the generic form the
Bytesiterator is well behaved itself and does not read ahead.It performs abysmally on top of a FileStream, and much better if a buffering reader is inserted inbetween.