1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-02 10:59:03 +01:00

update to alpha6

This commit is contained in:
Nikolay Kim 2019-04-14 10:30:37 -07:00
parent 345e67cd13
commit cb682b08e4
2 changed files with 14 additions and 22 deletions

View File

@ -28,7 +28,7 @@ default = ["web"]
web = ["actix/http", "actix-service", "actix-utils", "actix-web", "actix-session/cookie-session", "rand", "serde", "serde_json"] web = ["actix/http", "actix-service", "actix-utils", "actix-web", "actix-session/cookie-session", "rand", "serde", "serde_json"]
[dependencies] [dependencies]
actix = "0.8.0-alpha.2" actix = "0.8.0-alpha.3"
log = "0.4" log = "0.4"
backoff = "0.1" backoff = "0.1"
@ -41,10 +41,10 @@ redis-async = "0.4"
time = "0.1" time = "0.1"
# actix web session # actix web session
actix-web = { version = "1.0.0-alpha.2", optional=true } actix-web = { version = "1.0.0-alpha.6", optional=true }
actix-utils = { version = "0.3.3", optional=true } actix-utils = { version = "0.3.3", optional=true }
actix-service = { version = "0.3.4", optional=true } actix-service = { version = "0.3.4", optional=true }
actix-session = { version = "0.1.0-alpha.2", optional=true } actix-session = { version = "0.1.0-alpha.6", optional=true }
rand = { version="0.6.5", optional=true } rand = { version="0.6.5", optional=true }
serde = { version="1.0", optional=true } serde = { version="1.0", optional=true }
serde_json = { version="1.0", optional=true } serde_json = { version="1.0", optional=true }

View File

@ -90,18 +90,14 @@ impl RedisSession {
} }
} }
impl<S, P, B> Transform<S> for RedisSession impl<S, B> Transform<S> for RedisSession
where where
S: Service< S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>
Request = ServiceRequest<P>, + 'static,
Response = ServiceResponse<B>,
Error = Error,
> + 'static,
S::Future: 'static, S::Future: 'static,
P: 'static,
B: 'static, B: 'static,
{ {
type Request = ServiceRequest<P>; type Request = ServiceRequest;
type Response = ServiceResponse<B>; type Response = ServiceResponse<B>;
type Error = S::Error; type Error = S::Error;
type InitError = (); type InitError = ();
@ -122,18 +118,14 @@ pub struct RedisSessionMiddleware<S: 'static> {
inner: Rc<Inner>, inner: Rc<Inner>,
} }
impl<S, P, B> Service for RedisSessionMiddleware<S> impl<S, B> Service for RedisSessionMiddleware<S>
where where
S: Service< S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>
Request = ServiceRequest<P>, + 'static,
Response = ServiceResponse<B>,
Error = Error,
> + 'static,
S::Future: 'static, S::Future: 'static,
P: 'static,
B: 'static, B: 'static,
{ {
type Request = ServiceRequest<P>; type Request = ServiceRequest;
type Response = ServiceResponse<B>; type Response = ServiceResponse<B>;
type Error = Error; type Error = Error;
type Future = Box<Future<Item = Self::Response, Error = Self::Error>>; type Future = Box<Future<Item = Self::Response, Error = Self::Error>>;
@ -142,7 +134,7 @@ where
self.service.poll_ready() self.service.poll_ready()
} }
fn call(&mut self, mut req: ServiceRequest<P>) -> Self::Future { fn call(&mut self, mut req: ServiceRequest) -> Self::Future {
let mut srv = self.service.clone(); let mut srv = self.service.clone();
let inner = self.inner.clone(); let inner = self.inner.clone();
@ -178,9 +170,9 @@ struct Inner {
} }
impl Inner { impl Inner {
fn load<P>( fn load(
&self, &self,
req: &ServiceRequest<P>, req: &ServiceRequest,
) -> impl Future<Item = Option<(HashMap<String, String>, String)>, Error = Error> ) -> impl Future<Item = Option<(HashMap<String, String>, String)>, Error = Error>
{ {
if let Ok(cookies) = req.cookies() { if let Ok(cookies) = req.cookies() {