Allow ArchiveHandle to own its data - #157
Draft
george-steel wants to merge 1 commit into
Draft
Conversation
Collaborator
|
ill have to take a closer look once we start working towards the next semver-breaking release, but things look great at first glance 👍 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #157 +/- ##
==========================================
- Coverage 78.01% 77.40% -0.61%
==========================================
Files 27 27
Lines 2702 2731 +29
Branches 134 134
==========================================
+ Hits 2108 2114 +6
- Misses 525 548 +23
Partials 69 69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This allows the creation of
ArchiveHandles which own their backing data store, allowing them to be passed around more freely without the need for complex solutions such as yoke. For borrowed data, references to both slices and file handles are still valid data sources, preserving existing functionality. Originally discussed in #134.Currently implemented for rc-zip-sync only. Will implement this for rc-zip-tokio before marking this ready.
Breaking Changes:
ArchiveHandle<'a, F>is nowArchiveHandle<&'a F>.file.read_zip()now consumes the file instead of borrowing it if file is owned. The old functionality can be accessed inline withfile.borrow().read_zip().&[u8]instead of&&[u8]