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:
@@ -5,7 +5,7 @@ use super::HttpBody;
|
||||
/// Concatenate the buffers from a body into a single `Bytes` asynchronously.
|
||||
///
|
||||
/// This may require copying the data into a single buffer. If you don't need
|
||||
/// a contiguous buffer, prefer the [`aggregate`](crate::body::aggregate)
|
||||
/// a contiguous buffer, prefer the [`aggregate`](crate::body::aggregate())
|
||||
/// function.
|
||||
pub async fn to_bytes<T>(body: T) -> Result<Bytes, T::Error>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user