Require Sync for services (#2473)

Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
David Pedersen
2024-09-28 23:28:44 +02:00
committed by GitHub
co-authored by Jonas Platte
parent 19101f624d
commit 52fd139a86
14 changed files with 137 additions and 47 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ pub trait RouterExt<S>: sealed::Sealed {
/// This works like [`RouterExt::route_with_tsr`] but accepts any [`Service`].
fn route_service_with_tsr<T>(self, path: &str, service: T) -> Self
where
T: Service<Request, Error = Infallible> + Clone + Send + 'static,
T: Service<Request, Error = Infallible> + Clone + Send + Sync + 'static,
T::Response: IntoResponse,
T::Future: Send + 'static,
Self: Sized;
@@ -268,7 +268,7 @@ where
#[track_caller]
fn route_service_with_tsr<T>(mut self, path: &str, service: T) -> Self
where
T: Service<Request, Error = Infallible> + Clone + Send + 'static,
T: Service<Request, Error = Infallible> + Clone + Send + Sync + 'static,
T::Response: IntoResponse,
T::Future: Send + 'static,
Self: Sized,