Skip to content

require TransportStream is Sync#917

Merged
ginglis13 merged 1 commit into
awslabs:developfrom
iliana:transport-is-sync
Apr 17, 2026
Merged

require TransportStream is Sync#917
ginglis13 merged 1 commit into
awslabs:developfrom
iliana:transport-is-sync

Conversation

@iliana

@iliana iliana commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Fixes #928

Description of changes:

Streams returned from tough cannot be shared between threads because they are !Sync. As it turns out, all of the transports I'm aware of (the three in tough itself, and the one I've recently written to read from ZIP archives) return streams that are already Sync, but they can't be used in other parts of the Rust ecosystem that require Sync streams. (In my case I am currently butting up against dropshot::Body requiring Sync for a service that is proxying targets from a TUF repository.)

This stems from the use of futures::stream::BoxStream internally, whose type does not specify Send. Replacing .boxed() with Box::pin is sufficient.

This is a breaking change, but not one I expect most consumers will need to be concerned with.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ginglis13 ginglis13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @iliana , apologies for the delay in getting to this!

@ginglis13 ginglis13 merged commit 53580e0 into awslabs:develop Apr 17, 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.

tough::transport::TransportStream isn't Sync

3 participants