add `Response::into_boxed_body`

This commit is contained in:
Rob Ede 2021-11-24 14:15:46 +00:00
parent 19096b9b36
commit 10459915d7
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
2 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* Add timeout for canceling HTTP/2 server side connection handshake. Default to 5 seconds. [#2483]
* HTTP/2 handshake timeout can be configured with `ServiceConfig::client_timeout`. [#2483]
* Rename `body::BoxBody::{from_body => new}`. [#????]
* `Response::into_boxed_body`. [#????]
* `body::EitherBody` enum. [#????]
### Changed

View File

@ -228,7 +228,14 @@ impl<B> HttpResponse<B> {
}
// TODO: into_body equivalent
// TODO: into_boxed_body
pub(crate) fn into_boxed_body(self) -> HttpResponse<BoxBody>
where
B: MessageBody + 'static,
B::Error: Into<Box<dyn StdError + 'static>>,
{
self.map_body(|_, body| BoxBody::new(body))
}
/// Extract response body
pub fn into_body(self) -> B {