New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for readers that implement Seek (#218) #266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! This is definitely something I think that's worth implementing. I've got a few comments below, but I think this is going in a good direction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks!
done: false, | ||
next: 0, | ||
raw: false, | ||
}) | ||
} | ||
|
||
fn _unpack(&mut self, dst: &Path) -> io::Result<()> { | ||
fn _unpack(&'a mut self, dst: &Path) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this 'a
may no longer be necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustc seems to need this to determine the lifetime of the seekable_archive
argument when calling _entries()
.
`Archive::entries_with_seek` can be used to get an iterator over entries for a reader that implements `Seek`.
Ok looks great to me, thanks! |
Archive::new
requires onlyRead
for backward-compatibility, whileArchive::new_from_seek
can be used with readers that also implementSeek
, to allow more efficient skipping over file contents.