1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 03:21:08 +00:00

add ServiceResponse::into_parts (#2499)

This commit is contained in:
Ali MJ Al-Nasrawy 2021-12-09 17:57:27 +03:00 committed by GitHub
parent 774ac7fec4
commit f9348d7129
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -9,6 +9,7 @@
* `ServiceResponse::map_into_{left,right}_body` and `HttpResponse::map_into_boxed_body`. [#2468]
* Connection data set through the `HttpServer::on_connect` callback is now accessible only from the new `HttpRequest::conn_data()` and `ServiceRequest::conn_data()` methods. [#2491]
* `HttpRequest::{req_data,req_data_mut}`. [#2487]
* `ServiceResponse::into_parts`. [#2499]
### Changed
* Rename `Accept::{mime_precedence => ranked}`. [#2480]
@ -37,6 +38,7 @@
[#2491]: https://github.com/actix/actix-web/pull/2491
[#2492]: https://github.com/actix/actix-web/pull/2492
[#2493]: https://github.com/actix/actix-web/pull/2493
[#2499]: https://github.com/actix/actix-web/pull/2499
## 4.0.0-beta.13 - 2021-11-30

View file

@ -410,6 +410,12 @@ impl<B> ServiceResponse<B> {
self.response.headers_mut()
}
/// Destructures `ServiceResponse` into request and response components.
#[inline]
pub fn into_parts(self) -> (HttpRequest, HttpResponse<B>) {
(self.request, self.response)
}
/// Extract response body
#[inline]
pub fn into_body(self) -> B {