mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Clarify required response body type when routing to tower::Services (#69)
This commit is contained in:
+4
-3
@@ -9,11 +9,12 @@ pub use hyper::body::Body;
|
||||
|
||||
/// A boxed [`Body`] trait object.
|
||||
///
|
||||
/// This is used in axum as the response body type for applications. Its necessary to unify
|
||||
/// multiple response bodies types into one.
|
||||
/// This is used in axum as the response body type for applications. Its
|
||||
/// necessary to unify multiple response bodies types into one.
|
||||
pub type BoxBody = http_body::combinators::BoxBody<Bytes, BoxStdError>;
|
||||
|
||||
pub(crate) fn box_body<B>(body: B) -> BoxBody
|
||||
/// Convert a [`http_body::Body`] into a [`BoxBody`].
|
||||
pub fn box_body<B>(body: B) -> BoxBody
|
||||
where
|
||||
B: http_body::Body<Data = Bytes> + Send + Sync + 'static,
|
||||
B::Error: Into<BoxError>,
|
||||
|
||||
Reference in New Issue
Block a user