We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a29c7f9 commit d1022b3Copy full SHA for d1022b3
src/async_impl/response.rs
@@ -446,6 +446,16 @@ impl<T: Into<Body>> From<http::Response<T>> for Response {
446
}
447
448
449
+/// A `Response` can be converted into a `http::Response`.
450
+// It's supposed to be the inverse of the conversion above.
451
+impl From<Response> for http::Response<Body> {
452
+ fn from(r: Response) -> http::Response<Body> {
453
+ let (parts, body) = r.res.into_parts();
454
+ let body = Body::streaming(body);
455
+ http::Response::from_parts(parts, body)
456
+ }
457
+}
458
+
459
#[cfg(test)]
460
mod tests {
461
use super::Response;
0 commit comments