feat(body): implement HttpBody for Request and Response
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
This commit is contained in:
@@ -18,7 +18,7 @@ type BodySender = mpsc::Sender<Result<Bytes, crate::Error>>;
|
||||
|
||||
/// A stream of `Bytes`, used when receiving bodies.
|
||||
///
|
||||
/// A good default [`HttpBody`](crates::body::HttpBody) to use in many
|
||||
/// A good default [`HttpBody`](crate::body::HttpBody) to use in many
|
||||
/// applications.
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct Body {
|
||||
|
||||
Reference in New Issue
Block a user