This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
more efficient seeks #9
Comments
Are you looking for something like the unstable |
My code needs to be able to do both relative and from start seeks, but they likely will be inside the current buffer, due to the way they are called, so seek_relative is unfortunately not enough for me.
On a related note, in the linked tracking issue rust-lang/rust#31100 it seems that the sentiment is, to actually change the behaviour of seek, instead of stabilising seek_relative.
rust-lang/rust#31100 (comment)
…On 16. Nov 2018, 22:23 +0100, Austin Bonander ***@***.***>, wrote:
Are you looking for something like the unstable BufReader::seek_relative()? https://doc.rust-lang.org/nightly/std/io/struct.BufReader.html#method.seek_relative
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So you want the reader to store the absolute offset, to the best of its knowledge, and optimize for when seeks fall within the buffer. That's not unreasonable, but I think to avoid surprises this should be implemented as a wrapper type or at the very least a separate method. For cases where the user is expecting the data at a local offset to change in the underlying reader, this optimization would cause seeks to yield stale data. I'd rather keep the stdlib semantics for |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am looking into using seeking quite a bit and was wondering if it was possible to upgrade the seeking implementation like it is done here: https://github.com/gcarq/seek_bufread
the stdlib will hopefully get sth similar eventually, ref: rust-lang/rust#31100
The text was updated successfully, but these errors were encountered: