mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Implement IntoResponse for http::response::Parts (#490)
* Implement `IntoResponse` for `http::response::Parts` Not sure there are many use cases for this but still thinks it makes to provide since other crates can't. * Use `Response::from_parts`
This commit is contained in:
+3
-1
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
- None
|
- Implement `IntoResponse` for `http::response::Parts` ([#490])
|
||||||
|
|
||||||
|
[#490]: https://github.com/tokio-rs/axum/pull/490
|
||||||
|
|
||||||
# 0.3.2 (08. November, 2021)
|
# 0.3.2 (08. November, 2021)
|
||||||
|
|
||||||
|
|||||||
@@ -245,6 +245,15 @@ impl_into_response_for_body!(hyper::Body);
|
|||||||
impl_into_response_for_body!(Full<Bytes>);
|
impl_into_response_for_body!(Full<Bytes>);
|
||||||
impl_into_response_for_body!(Empty<Bytes>);
|
impl_into_response_for_body!(Empty<Bytes>);
|
||||||
|
|
||||||
|
impl IntoResponse for http::response::Parts {
|
||||||
|
type Body = Empty<Bytes>;
|
||||||
|
type BodyError = Infallible;
|
||||||
|
|
||||||
|
fn into_response(self) -> Response<Self::Body> {
|
||||||
|
Response::from_parts(self, Empty::new())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<E> IntoResponse for http_body::combinators::BoxBody<Bytes, E>
|
impl<E> IntoResponse for http_body::combinators::BoxBody<Bytes, E>
|
||||||
where
|
where
|
||||||
E: Into<BoxError> + 'static,
|
E: Into<BoxError> + 'static,
|
||||||
|
|||||||
Reference in New Issue
Block a user