Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd fn skip(n: uint) with a default implementation to Reader #13989
Comments
alexcrichton
added
the
A-io
label
May 6, 2014
This comment has been minimized.
This comment has been minimized.
|
This seems useful though reader does have a few methods on it already. I'm wondering what @alexcrichton thinks? |
This comment has been minimized.
This comment has been minimized.
|
I'm worried about adding more methods to readers that downstream consumers need to consider to override. Having one I don't think that we can quite use |
This comment has been minimized.
This comment has been minimized.
|
Any news on this? I'm writing an IFF reader and I want users to be able to skip chunk bodies, requiring Seek for just this seems overkill. |
This comment has been minimized.
This comment has been minimized.
|
The problem is that given today's (and likely future) coherence rules, you cannot create a trait that uses
This is actually a decent motivating use-case for allowing an implementation of a trait to refine an existing implementation defined on a superset of types. |
This comment has been minimized.
This comment has been minimized.
|
@pongad I do not think |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton it is true that having too many random convenience methods can be a problem, but I think that it makes sense to add methods for operations that can be implemented much more efficiently in some contexts than others. In other words, while |
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Oct 18, 2014
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Oct 18, 2014
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Oct 18, 2014
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Oct 18, 2014
nodakai
referenced this issue
Oct 18, 2014
Closed
Add skip(n: uint) to Read, Seek, File, MemReader and BufferedReader #18137
aturon
referenced this issue
Jan 24, 2015
Closed
I'd like an efficient way to discard data from a Reader. #19022
This comment has been minimized.
This comment has been minimized.
|
@carllerche did this end up getting addressed in io reform? |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik Not yet. I think (hope) it is coming pre 1.0 though. cc @aturon |
This comment has been minimized.
This comment has been minimized.
|
Nominating for 1.0-beta P-high. (Should be trivial.) |
aturon
added
the
I-nominated
label
Feb 16, 2015
This comment has been minimized.
This comment has been minimized.
|
P-high, I-needs-decision (not 1.0 beta blocker) |
pnkfelix
added
P-medium
I-needs-decision
and removed
I-nominated
labels
Feb 19, 2015
huonw
added
I-nominated
T-libs
and removed
I-needs-decision
labels
Jan 8, 2016
This comment has been minimized.
This comment has been minimized.
|
In today's day and age this sort of addition (to a core trait like |
carllerche commentedMay 6, 2014
Reader should have an extra fn that allows skipping a number of bytes. The default implementation could look something like:
However, BufReader could implement the fn by simply updating the internal cursor. This would allow more efficient skipping w/o having to require Seek.