Skip to content

Allow ArchiveHandle to own its data - #157

Draft
george-steel wants to merge 1 commit into
bearcove:mainfrom
george-steel:owned-source
Draft

Allow ArchiveHandle to own its data#157
george-steel wants to merge 1 commit into
bearcove:mainfrom
george-steel:owned-source

Conversation

@george-steel

@george-steel george-steel commented Jan 8, 2026

Copy link
Copy Markdown

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:

  • The type previously referred to as ArchiveHandle<'a, F> is now ArchiveHandle<&'a F>.
  • file.read_zip() now consumes the file instead of borrowing it if file is owned. The old functionality can be accessed inline with file.borrow().read_zip().
  • Creating an ArchiveHandle from in-memory data now requires a &[u8] instead of &&[u8]

@CosmicHorrorDev

CosmicHorrorDev commented Jan 8, 2026

Copy link
Copy Markdown
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

codecov Bot commented Jan 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.60606% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.40%. Comparing base (d532eb0) to head (21d0a85).

Files with missing lines Patch % Lines
rc-zip-sync/src/read_zip.rs 60.00% 24 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@george-steel george-steel mentioned this pull request Jan 8, 2026
14 tasks
@sftse sftse mentioned this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants