diff --git a/actix-utils/src/order.rs b/actix-utils/src/order.rs index 1f33cad1..b35044b6 100644 --- a/actix-utils/src/order.rs +++ b/actix-utils/src/order.rs @@ -43,17 +43,34 @@ pub struct InOrder { _t: PhantomData, } -impl InOrder { +impl InOrder +where + S: Service, + S::Response: 'static, + S::Future: 'static, + S::Error: 'static, +{ pub fn new() -> Self { Self { _t: PhantomData } } - pub fn service() -> Self { - Self { _t: PhantomData } + pub fn service() -> impl Transform< + S, + Request = S::Request, + Response = S::Response, + Error = InOrderError, + > { + InOrderService::new() } } -impl Default for InOrder { +impl Default for InOrder +where + S: Service, + S::Response: 'static, + S::Future: 'static, + S::Error: 'static, +{ fn default() -> Self { Self::new() }