1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-31 18:36:59 +02:00

service improvements (#233)

This commit is contained in:
Rob Ede
2020-12-27 14:15:42 +00:00
committed by GitHub
parent 33c9aa6988
commit 8a58a341a4
27 changed files with 387 additions and 1179 deletions

View File

@@ -1,6 +1,10 @@
use std::pin::Pin;
use std::task::{Context, Poll};
use std::{future::Future, marker::PhantomData};
use alloc::boxed::Box;
use core::{
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
use futures_util::future::FutureExt;
@@ -28,7 +32,7 @@ where
{
BoxServiceFactory(Box::new(FactoryWrapper {
factory,
_t: std::marker::PhantomData,
_t: PhantomData,
}))
}
@@ -75,12 +79,9 @@ where
}
}
struct FactoryWrapper<SF, Req, C>
where
SF: ServiceFactory<Req>,
{
struct FactoryWrapper<SF, Req, Cfg> {
factory: SF,
_t: PhantomData<(C, Req)>,
_t: PhantomData<(Req, Cfg)>,
}
impl<SF, Req, Cfg, Res, Err, InitErr> ServiceFactory<Req> for FactoryWrapper<SF, Req, Cfg>