-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Consider implementing HttpBody for Request and Response #2067
Comments
seanmonstar
added
B-rfc
Blocked: More comments would be useful in determine next steps.
A-body
Area: body streaming.
labels
Dec 11, 2019
I think this makes sense but forces http to be async I guess unless we put it behind a feature flag. Otherwise, I think this could be a great addition. |
How does it force http to be async? It'd only implement in the |
Ah you're right, if the impl is in the http-body crate then I am +1 |
seanmonstar
added
E-easy
Effort: easy. A task that would be a great starting point for a new contributor.
C-feature
Category: feature. This is adding a new feature.
and removed
B-rfc
Blocked: More comments would be useful in determine next steps.
labels
Dec 11, 2019
seanmonstar
added a commit
that referenced
this issue
Dec 13, 2019
When the body type of a `Request` or `Response` implements `HttpBody`, the `Request` or `Response` itself now implements `HttpBody`. This allows writing things like `hyper::body::aggregate(req)` instead of `hyper::body::aggregate(req.into_body())`. Closes #2067
seanmonstar
added a commit
that referenced
this issue
Dec 13, 2019
When the body type of a `Request` or `Response` implements `HttpBody`, the `Request` or `Response` itself now implements `HttpBody`. This allows writing things like `hyper::body::aggregate(req)` instead of `hyper::body::aggregate(req.into_body())`. Closes #2067
seanmonstar
added a commit
that referenced
this issue
Dec 13, 2019
When the body type of a `Request` or `Response` implements `HttpBody`, the `Request` or `Response` itself now implements `HttpBody`. This allows writing things like `hyper::body::aggregate(req)` instead of `hyper::body::aggregate(req.into_body())`. Closes #2067
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In hyperium/http#107, we didn't implement
Stream
forhttp::{Request, Response}
so as to not have the external dependency. However, inhttp-body
, since we define the trait and importhttp
, we could provide this implementation.It'd make these slightly nicer:
The text was updated successfully, but these errors were encountered: