From 3bddba5da5fbc3597c675d59f3a9da2c84eb6003 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 3 Feb 2019 14:12:15 -0800 Subject: [PATCH] helper method --- actix-utils/src/order.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) 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() }