Skip to content

Require Send for FilePayload readers - #411

Merged
woodruffw merged 2 commits into
mainfrom
ww/send-file-payload
Nov 30, 2026
Merged

woodruffw merged 2 commits into
mainfrom
ww/send-file-payload

Conversation

@woodruffw

@woodruffw woodruffw commented Nov 30, 2026 •

Copy link
Copy Markdown
Member
Automated notes

FilePayload boxed its reader as dyn AsyncRead, erasing Send even for a Tokio file. Both add_file and add_directory_all hold a payload across an .await, so even adding a byte slice prevented callers from spawning the encoding task with tokio::spawn.

Require Send on the reader and preserve it in the trait object. This is a breaking change for callers that pass a !Send reader to FilePayload::new. Callers that erase the reader type must include + Send in the trait object.

A tar encoding test checks at compile time that both futures are Send. I also verified a directory round trip with async-compression and tokio::spawn.

Related to #409.

Fixes #409

@codspeed

codspeed Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 57 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing ww/send-file-payload (d22c3b3) with main (0f12e67)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@woodruffw
woodruffw marked this pull request as ready for review November 30, 2026 18:02
@woodruffw
woodruffw merged commit 2628d40 into main Nov 30, 2026
12 checks passed
@woodruffw
woodruffw deleted the ww/send-file-payload branch November 30, 2026 18:04
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.

docs: better examples for tar-codec crate

1 participant