Skip to content
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

Sync bound in Body::wrap_stream back after v0.12.0 #2273

Closed
ikai104 opened this issue May 2, 2024 · 2 comments
Closed

Sync bound in Body::wrap_stream back after v0.12.0 #2273

ikai104 opened this issue May 2, 2024 · 2 comments

Comments

@ikai104
Copy link

ikai104 commented May 2, 2024

Sync bound in Body::wrap_stream() had removed since #2088 (v0.11.24) but it back again at v0.12.0.

I can't found any document for it so maybe just an accident?

@frederikhors
Copy link

@jofas
Copy link

jofas commented Jun 5, 2024

@frederikhors your other URLO-topic is also somewhat related:

I tried reqwest::Body::wrap_stream with both axum::Body::into_data_stream and http_body_util::BodyStream, both failed because axum::body::Body is not Sync.

#2088 seems to be at least partially motivated by the need to use axum's BodyDataStream with reqwest's Body type:

By using SyncWrapper we can avoid requiring Sync for the stream passed to Body::wrap_stream. This makes it easier to use streams like axum's BodyDataStream.

I think it was indeed just an accident that the Sync bound was reintroduced in #2059, at least that is how I interpret #2229 (comment)

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

No branches or pull requests

3 participants