mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Accept S::Response: IntoResponse everywhere (#1165)
This commit is contained in:
@@ -2,7 +2,7 @@ use axum::{
|
||||
body::Body,
|
||||
handler::Handler,
|
||||
http::Request,
|
||||
response::Response,
|
||||
response::IntoResponse,
|
||||
routing::{delete, get, on, post, MethodFilter},
|
||||
Router,
|
||||
};
|
||||
@@ -141,7 +141,8 @@ where
|
||||
/// The routes will be nested at `/{resource_name}/:{resource_name}_id`.
|
||||
pub fn nest<T>(mut self, svc: T) -> Self
|
||||
where
|
||||
T: Service<Request<B>, Response = Response, Error = Infallible> + Clone + Send + 'static,
|
||||
T: Service<Request<B>, Error = Infallible> + Clone + Send + 'static,
|
||||
T::Response: IntoResponse,
|
||||
T::Future: Send + 'static,
|
||||
{
|
||||
let path = self.show_update_destroy_path();
|
||||
@@ -154,7 +155,8 @@ where
|
||||
/// The routes will be nested at `/{resource_name}`.
|
||||
pub fn nest_collection<T>(mut self, svc: T) -> Self
|
||||
where
|
||||
T: Service<Request<B>, Response = Response, Error = Infallible> + Clone + Send + 'static,
|
||||
T: Service<Request<B>, Error = Infallible> + Clone + Send + 'static,
|
||||
T::Response: IntoResponse,
|
||||
T::Future: Send + 'static,
|
||||
{
|
||||
let path = self.index_create_path();
|
||||
@@ -172,7 +174,8 @@ where
|
||||
|
||||
fn route<T>(mut self, path: &str, svc: T) -> Self
|
||||
where
|
||||
T: Service<Request<B>, Response = Response, Error = Infallible> + Clone + Send + 'static,
|
||||
T: Service<Request<B>, Error = Infallible> + Clone + Send + 'static,
|
||||
T::Response: IntoResponse,
|
||||
T::Future: Send + 'static,
|
||||
{
|
||||
self.router = self.router.route(path, svc);
|
||||
|
||||
Reference in New Issue
Block a user