1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-18 09:41:49 +01:00

helper method

This commit is contained in:
Nikolay Kim 2019-02-03 14:12:15 -08:00
parent 4be025926c
commit 3bddba5da5

View File

@ -43,17 +43,34 @@ pub struct InOrder<S> {
_t: PhantomData<S>, _t: PhantomData<S>,
} }
impl<S> InOrder<S> { impl<S> InOrder<S>
where
S: Service,
S::Response: 'static,
S::Future: 'static,
S::Error: 'static,
{
pub fn new() -> Self { pub fn new() -> Self {
Self { _t: PhantomData } Self { _t: PhantomData }
} }
pub fn service() -> Self { pub fn service() -> impl Transform<
Self { _t: PhantomData } S,
Request = S::Request,
Response = S::Response,
Error = InOrderError<S::Error>,
> {
InOrderService::new()
} }
} }
impl<S> Default for InOrder<S> { impl<S> Default for InOrder<S>
where
S: Service,
S::Response: 'static,
S::Future: 'static,
S::Error: 'static,
{
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }