From 03248028a9a7f140a168fdc9a2797ee81210cec7 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 5 Mar 2019 10:08:08 -0800 Subject: [PATCH] update actix-service --- Cargo.toml | 15 ++++- src/app.rs | 111 ++++++++++++------------------- src/handler.rs | 18 ++--- src/middleware/compress.rs | 14 ++-- src/middleware/defaultheaders.rs | 10 ++- src/middleware/mod.rs | 3 + src/resource.rs | 30 ++++----- src/route.rs | 47 +++++++------ src/scope.rs | 25 +++---- src/server.rs | 12 ++-- src/service.rs | 6 +- 11 files changed, 132 insertions(+), 159 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b4ad38a6..f473ac554 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ members = [ ] [package.metadata.docs.rs] -features = ["ssl", "tls", "rust-tls"] +features = ["ssl", "tls", "rust-tls"] #, "session"] [features] default = ["brotli", "flate2-c"] @@ -45,6 +45,9 @@ flate2-c = ["flate2/miniz-sys"] # rust backend for flate2 crate flate2-rust = ["flate2/rust_backend"] +# sessions feature, session require "ring" crate and c compiler +# session = ["actix-session"] + # tls tls = ["native-tls", "actix-server/ssl"] @@ -56,10 +59,13 @@ ssl = ["openssl", "actix-server/ssl"] [dependencies] actix-codec = "0.1.0" -actix-service = "0.3.2" -actix-utils = "0.3.1" +#actix-service = "0.3.2" +#actix-utils = "0.3.1" actix-rt = "0.1.0" +actix-service = { git = "https://github.com/actix/actix-net.git" } +actix-utils = { git = "https://github.com/actix/actix-net.git" } + actix-http = { git = "https://github.com/actix/actix-http.git" } actix-router = { git = "https://github.com/actix/actix-net.git" } actix-server = { git = "https://github.com/actix/actix-net.git" } @@ -79,6 +85,9 @@ serde_json = "1.0" serde_urlencoded = "^0.5.3" threadpool = "1.7" +# middlewares +# actix-session = { path="session", optional = true } + # compression brotli2 = { version="^0.3.2", optional = true } flate2 = { version="^1.0.2", optional = true, default-features = false } diff --git a/src/app.rs b/src/app.rs index 8336fcca3..b21645016 100644 --- a/src/app.rs +++ b/src/app.rs @@ -25,7 +25,7 @@ type HttpNewService

= BoxedNewService<(), ServiceRequest

, ServiceResponse, type BoxedResponse = Box>; pub trait HttpServiceFactory { - type Factory: NewService; + type Factory: NewService; fn rdef(&self) -> &ResourceDef; @@ -36,7 +36,7 @@ pub trait HttpServiceFactory { /// for building application instances. pub struct App where - T: NewService, Response = ServiceRequest

>, + T: NewService>, { chain: T, extensions: Extensions, @@ -61,7 +61,7 @@ impl App where P: 'static, T: NewService< - Request = ServiceRequest, + ServiceRequest, Response = ServiceRequest

, Error = (), InitError = (), @@ -197,7 +197,7 @@ where where F: FnOnce(Resource

) -> Resource, U: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -230,7 +230,7 @@ where P, B, impl NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -239,12 +239,12 @@ where where M: Transform< AppRouting

, - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), >, - F: IntoTransform>, + F: IntoTransform, ServiceRequest

>, { let fref = Rc::new(RefCell::new(None)); let endpoint = ApplyTransform::new(mw, AppEntry::new(fref.clone())); @@ -269,7 +269,7 @@ where ) -> App< P1, impl NewService< - Request = ServiceRequest, + ServiceRequest, Response = ServiceRequest, Error = (), InitError = (), @@ -277,13 +277,12 @@ where > where C: NewService< - (), - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceRequest, Error = (), InitError = (), >, - F: IntoNewService, + F: IntoNewService>, { let chain = self.chain.and_then(chain.into_new_service()); App { @@ -326,7 +325,7 @@ where P: 'static, B: MessageBody, T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -406,7 +405,7 @@ where where F: FnOnce(Resource

) -> Resource, U: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -430,12 +429,9 @@ where pub fn default_resource(mut self, f: F) -> Self where F: FnOnce(Resource

) -> R, - R: IntoNewService, - U: NewService< - Request = ServiceRequest

, - Response = ServiceResponse, - Error = (), - > + 'static, + R: IntoNewService>, + U: NewService, Response = ServiceResponse, Error = ()> + + 'static, { // create and configure default resource self.default = Some(Rc::new(boxed::new_service( @@ -449,12 +445,9 @@ where pub fn service(mut self, rdef: R, factory: F) -> Self where R: Into, - F: IntoNewService, - U: NewService< - Request = ServiceRequest

, - Response = ServiceResponse, - Error = (), - > + 'static, + F: IntoNewService>, + U: NewService, Response = ServiceResponse, Error = ()> + + 'static, { self.services.push(( rdef.into(), @@ -473,7 +466,7 @@ where P, B1, impl NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -482,13 +475,13 @@ where where M: Transform< T::Service, - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), >, B1: MessageBody, - F: IntoTransform, + F: IntoTransform>, { let endpoint = ApplyTransform::new(mw, self.endpoint); AppRouter { @@ -542,22 +535,23 @@ where } impl - IntoNewService, T, ()>> for AppRouter + IntoNewService, T>, Request> + for AppRouter where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), >, C: NewService< - Request = ServiceRequest, + ServiceRequest, Response = ServiceRequest

, Error = (), InitError = (), >, { - fn into_new_service(self) -> AndThenNewService, T, ()> { + fn into_new_service(self) -> AndThenNewService, T> { // update resource default service if self.default.is_some() { for default in &self.defaults { @@ -592,8 +586,7 @@ pub struct AppRoutingFactory

{ default: Option>>, } -impl NewService for AppRoutingFactory

{ - type Request = ServiceRequest

; +impl NewService> for AppRoutingFactory

{ type Response = ServiceResponse; type Error = (); type InitError = (); @@ -709,8 +702,7 @@ pub struct AppRouting

{ default: Option>, } -impl

Service for AppRouting

{ - type Request = ServiceRequest

; +impl

Service> for AppRouting

{ type Response = ServiceResponse; type Error = (); type Future = Either>; @@ -758,8 +750,7 @@ impl

AppEntry

{ } } -impl NewService for AppEntry

{ - type Request = ServiceRequest

; +impl NewService> for AppEntry

{ type Response = ServiceResponse; type Error = (); type InitError = (); @@ -774,9 +765,8 @@ impl NewService for AppEntry

{ #[doc(hidden)] pub struct AppChain; -impl NewService<()> for AppChain { - type Request = ServiceRequest; - type Response = ServiceRequest; +impl NewService for AppChain { + type Response = ServiceRequest; type Error = (); type InitError = (); type Service = AppChain; @@ -787,9 +777,8 @@ impl NewService<()> for AppChain { } } -impl Service for AppChain { - type Request = ServiceRequest; - type Response = ServiceRequest; +impl Service for AppChain { + type Response = ServiceRequest; type Error = (); type Future = FutureResult; @@ -799,7 +788,7 @@ impl Service for AppChain { } #[inline] - fn call(&mut self, req: Self::Request) -> Self::Future { + fn call(&mut self, req: ServiceRequest) -> Self::Future { ok(req) } } @@ -808,22 +797,17 @@ impl Service for AppChain { /// It also executes state factories. pub struct AppInit where - C: NewService, Response = ServiceRequest

>, + C: NewService>, { chain: C, state: Vec>, extensions: Rc>>, } -impl NewService for AppInit +impl NewService for AppInit where - C: NewService< - Request = ServiceRequest, - Response = ServiceRequest

, - InitError = (), - >, + C: NewService, InitError = ()>, { - type Request = Request; type Response = ServiceRequest

; type Error = C::Error; type InitError = C::InitError; @@ -842,11 +826,7 @@ where #[doc(hidden)] pub struct AppInitResult where - C: NewService< - Request = ServiceRequest, - Response = ServiceRequest

, - InitError = (), - >, + C: NewService, InitError = ()>, { chain: C::Future, state: Vec>, @@ -855,11 +835,7 @@ where impl Future for AppInitResult where - C: NewService< - Request = ServiceRequest, - Response = ServiceRequest

, - InitError = (), - >, + C: NewService, InitError = ()>, { type Item = AppInitService; type Error = C::InitError; @@ -893,17 +869,16 @@ where /// Service to convert `Request` to a `ServiceRequest` pub struct AppInitService where - C: Service, Response = ServiceRequest

>, + C: Service>, { chain: C, extensions: Rc, } -impl Service for AppInitService +impl Service for AppInitService where - C: Service, Response = ServiceRequest

>, + C: Service>, { - type Request = Request; type Response = ServiceRequest

; type Error = C::Error; type Future = C::Future; @@ -912,7 +887,7 @@ where self.chain.poll_ready() } - fn call(&mut self, req: Request) -> Self::Future { + fn call(&mut self, req: Request) -> Self::Future { let req = ServiceRequest::new( Path::new(Url::new(req.uri().clone())), req, diff --git a/src/handler.rs b/src/handler.rs index 98a36c562..442dc60d8 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -52,12 +52,11 @@ where } } } -impl NewService for Handle +impl NewService<(T, HttpRequest)> for Handle where F: Factory, R: Responder + 'static, { - type Request = (T, HttpRequest); type Response = ServiceResponse; type Error = Void; type InitError = (); @@ -82,12 +81,11 @@ where _t: PhantomData<(T, R)>, } -impl Service for HandleService +impl Service<(T, HttpRequest)> for HandleService where F: Factory, R: Responder + 'static, { - type Request = (T, HttpRequest); type Response = ServiceResponse; type Error = Void; type Future = HandleServiceResponse<::Future>; @@ -184,14 +182,13 @@ where } } } -impl NewService for AsyncHandle +impl NewService<(T, HttpRequest)> for AsyncHandle where F: AsyncFactory, R: IntoFuture, R::Item: Into, R::Error: Into, { - type Request = (T, HttpRequest); type Response = ServiceResponse; type Error = (); type InitError = (); @@ -218,14 +215,13 @@ where _t: PhantomData<(T, R)>, } -impl Service for AsyncHandleService +impl Service<(T, HttpRequest)> for AsyncHandleService where F: AsyncFactory, R: IntoFuture, R::Item: Into, R::Error: Into, { - type Request = (T, HttpRequest); type Response = ServiceResponse; type Error = (); type Future = AsyncHandleServiceResponse; @@ -290,8 +286,7 @@ impl> Extract { } } -impl> NewService for Extract { - type Request = ServiceRequest

; +impl> NewService> for Extract { type Response = (T, HttpRequest); type Error = (Error, ServiceFromRequest

); type InitError = (); @@ -311,8 +306,7 @@ pub struct ExtractService> { _t: PhantomData<(P, T)>, } -impl> Service for ExtractService { - type Request = ServiceRequest

; +impl> Service> for ExtractService { type Response = (T, HttpRequest); type Error = (Error, ServiceFromRequest

); type Future = ExtractResponse; diff --git a/src/middleware/compress.rs b/src/middleware/compress.rs index b95553cb5..c6f090a68 100644 --- a/src/middleware/compress.rs +++ b/src/middleware/compress.rs @@ -36,14 +36,13 @@ impl Default for Compress { } } -impl Transform for Compress +impl Transform> for Compress where P: 'static, B: MessageBody, - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { - type Request = ServiceRequest

; type Response = ServiceResponse>; type Error = S::Error; type InitError = (); @@ -63,14 +62,13 @@ pub struct CompressMiddleware { encoding: ContentEncoding, } -impl Service for CompressMiddleware +impl Service> for CompressMiddleware where P: 'static, B: MessageBody, - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { - type Request = ServiceRequest

; type Response = ServiceResponse>; type Error = S::Error; type Future = CompressResponse; @@ -103,7 +101,7 @@ pub struct CompressResponse where P: 'static, B: MessageBody, - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { fut: S::Future, @@ -114,7 +112,7 @@ impl Future for CompressResponse where P: 'static, B: MessageBody, - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { type Item = ServiceResponse>; diff --git a/src/middleware/defaultheaders.rs b/src/middleware/defaultheaders.rs index 2bd1d5d46..5fd519195 100644 --- a/src/middleware/defaultheaders.rs +++ b/src/middleware/defaultheaders.rs @@ -84,12 +84,11 @@ impl DefaultHeaders { } } -impl Transform for DefaultHeaders +impl Transform> for DefaultHeaders where - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { - type Request = ServiceRequest

; type Response = ServiceResponse; type Error = S::Error; type InitError = (); @@ -109,12 +108,11 @@ pub struct DefaultHeadersMiddleware { inner: Rc, } -impl Service for DefaultHeadersMiddleware +impl Service> for DefaultHeadersMiddleware where - S: Service, Response = ServiceResponse>, + S: Service, Response = ServiceResponse>, S::Future: 'static, { - type Request = ServiceRequest

; type Response = ServiceResponse; type Error = S::Error; type Future = Box>; diff --git a/src/middleware/mod.rs b/src/middleware/mod.rs index fc9923029..8c4cd7543 100644 --- a/src/middleware/mod.rs +++ b/src/middleware/mod.rs @@ -5,3 +5,6 @@ pub use self::compress::Compress; mod defaultheaders; pub use self::defaultheaders::DefaultHeaders; + +#[cfg(feature = "session")] +pub use actix_session as session; diff --git a/src/resource.rs b/src/resource.rs index 755b8d075..8d81ead06 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -65,7 +65,7 @@ impl

Default for Resource

{ impl Resource where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -187,7 +187,7 @@ where ) -> Resource< P, impl NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -196,12 +196,12 @@ where where M: Transform< T::Service, - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), >, - F: IntoTransform, + F: IntoTransform>, { let endpoint = ApplyTransform::new(mw, self.endpoint); Resource { @@ -216,12 +216,9 @@ where pub fn default_resource(mut self, f: F) -> Self where F: FnOnce(Resource

) -> R, - R: IntoNewService, - U: NewService< - Request = ServiceRequest

, - Response = ServiceResponse, - Error = (), - > + 'static, + R: IntoNewService>, + U: NewService, Response = ServiceResponse, Error = ()> + + 'static, { // create and configure default resource self.default = Rc::new(RefCell::new(Some(Rc::new(boxed::new_service( @@ -236,10 +233,10 @@ where } } -impl IntoNewService for Resource +impl IntoNewService> for Resource where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -260,8 +257,7 @@ pub struct ResourceFactory

{ default: Rc>>>>, } -impl NewService for ResourceFactory

{ - type Request = ServiceRequest

; +impl NewService> for ResourceFactory

{ type Response = ServiceResponse; type Error = (); type InitError = (); @@ -351,8 +347,7 @@ pub struct ResourceService

{ default: Option>, } -impl

Service for ResourceService

{ - type Request = ServiceRequest

; +impl

Service> for ResourceService

{ type Response = ServiceResponse; type Error = (); type Future = Either< @@ -396,8 +391,7 @@ impl

ResourceEndpoint

{ } } -impl NewService for ResourceEndpoint

{ - type Request = ServiceRequest

; +impl NewService> for ResourceEndpoint

{ type Response = ServiceResponse; type Error = (); type InitError = (); diff --git a/src/route.rs b/src/route.rs index 72abeb324..42e784881 100644 --- a/src/route.rs +++ b/src/route.rs @@ -1,4 +1,5 @@ use std::cell::RefCell; +use std::marker::PhantomData; use std::rc::Rc; use actix_http::{http::Method, Error, Extensions, Response}; @@ -14,7 +15,7 @@ use crate::HttpResponse; type BoxedRouteService = Box< Service< - Request = Req, + Req, Response = Res, Error = (), Future = Box>, @@ -23,7 +24,7 @@ type BoxedRouteService = Box< type BoxedRouteNewService = Box< NewService< - Request = Req, + Req, Response = Res, Error = (), InitError = (), @@ -85,8 +86,7 @@ impl Route

{ } } -impl

NewService for Route

{ - type Request = ServiceRequest

; +impl

NewService> for Route

{ type Response = ServiceResponse; type Error = (); type InitError = (); @@ -141,8 +141,7 @@ impl

RouteService

{ } } -impl

Service for RouteService

{ - type Request = ServiceRequest

; +impl

Service> for RouteService

{ type Response = ServiceResponse; type Error = (); type Future = Box>; @@ -151,7 +150,7 @@ impl

Service for RouteService

{ self.service.poll_ready() } - fn call(&mut self, req: Self::Request) -> Self::Future { + fn call(&mut self, req: ServiceRequest

) -> Self::Future { self.service.call(req) } } @@ -348,43 +347,46 @@ impl Route

{ struct RouteNewService where - T: NewService, Error = (Error, ServiceFromRequest

)>, + T: NewService, Error = (Error, ServiceFromRequest

)>, { service: T, + _t: PhantomData

, } impl RouteNewService where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (Error, ServiceFromRequest

), >, T::Future: 'static, T::Service: 'static, - ::Future: 'static, + >>::Future: 'static, { pub fn new(service: T) -> Self { - RouteNewService { service } + RouteNewService { + service, + _t: PhantomData, + } } } -impl NewService for RouteNewService +impl NewService> for RouteNewService where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (Error, ServiceFromRequest

), >, T::Future: 'static, T::Service: 'static, - ::Future: 'static, + >>::Future: 'static, { - type Request = ServiceRequest

; type Response = ServiceResponse; type Error = (); type InitError = (); - type Service = BoxedRouteService; + type Service = BoxedRouteService, Self::Response>; type Future = Box>; fn new_service(&self, _: &()) -> Self::Future { @@ -394,27 +396,30 @@ where .map_err(|_| ()) .and_then(|service| { let service: BoxedRouteService<_, _> = - Box::new(RouteServiceWrapper { service }); + Box::new(RouteServiceWrapper { + service, + _t: PhantomData, + }); Ok(service) }), ) } } -struct RouteServiceWrapper>> { +struct RouteServiceWrapper>> { service: T, + _t: PhantomData

, } -impl Service for RouteServiceWrapper +impl Service> for RouteServiceWrapper where T::Future: 'static, T: Service< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (Error, ServiceFromRequest

), >, { - type Request = ServiceRequest

; type Response = ServiceResponse; type Error = (); type Future = Box>; diff --git a/src/scope.rs b/src/scope.rs index b255ac14b..fa7392b41 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -79,7 +79,7 @@ impl Scope

{ impl Scope where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -196,7 +196,7 @@ where where F: FnOnce(Resource

) -> Resource, U: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -219,7 +219,7 @@ where where F: FnOnce(Resource

) -> Resource, U: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -244,7 +244,7 @@ where ) -> Scope< P, impl NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -253,12 +253,12 @@ where where M: Transform< T::Service, - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), >, - F: IntoTransform, + F: IntoTransform>, { let endpoint = ApplyTransform::new(mw, self.endpoint); Scope { @@ -293,10 +293,10 @@ pub(crate) fn insert_slash(path: &str) -> String { path } -impl IntoNewService for Scope +impl IntoNewService> for Scope where T: NewService< - Request = ServiceRequest

, + ServiceRequest

, Response = ServiceResponse, Error = (), InitError = (), @@ -331,8 +331,7 @@ pub struct ScopeFactory

{ default: Rc>>>>, } -impl NewService for ScopeFactory

{ - type Request = ServiceRequest

; +impl NewService> for ScopeFactory

{ type Response = ServiceResponse; type Error = (); type InitError = (); @@ -448,8 +447,7 @@ pub struct ScopeService

{ _ready: Option<(ServiceRequest

, ResourceInfo)>, } -impl

Service for ScopeService

{ - type Request = ServiceRequest

; +impl

Service> for ScopeService

{ type Response = ServiceResponse; type Error = (); type Future = Either>; @@ -492,8 +490,7 @@ impl

ScopeEndpoint

{ } } -impl NewService for ScopeEndpoint

{ - type Request = ServiceRequest

; +impl NewService> for ScopeEndpoint

{ type Response = ServiceResponse; type Error = (); type InitError = (); diff --git a/src/server.rs b/src/server.rs index 95cab2b08..78ba692e4 100644 --- a/src/server.rs +++ b/src/server.rs @@ -52,8 +52,8 @@ struct Config { pub struct HttpServer where F: Fn() -> I + Send + Clone + 'static, - I: IntoNewService, - S: NewService, + I: IntoNewService, + S: NewService, S::Error: fmt::Debug, S::Response: Into>, S::Service: 'static, @@ -71,8 +71,8 @@ where impl HttpServer where F: Fn() -> I + Send + Clone + 'static, - I: IntoNewService, - S: NewService, + I: IntoNewService, + S: NewService, S::Error: fmt::Debug, S::Response: Into>, S::Service: 'static, @@ -431,8 +431,8 @@ where impl HttpServer where F: Fn() -> I + Send + Clone + 'static, - I: IntoNewService, - S: NewService, + I: IntoNewService, + S: NewService, S::Error: fmt::Debug, S::Response: Into>, S::Service: 'static, diff --git a/src/service.rs b/src/service.rs index 637a8668a..50b2924ad 100644 --- a/src/service.rs +++ b/src/service.rs @@ -5,15 +5,15 @@ use std::rc::Rc; use actix_http::body::{Body, MessageBody, ResponseBody}; use actix_http::http::{HeaderMap, Method, Uri, Version}; use actix_http::{ - Error, Extensions, HttpMessage, Payload, Request, RequestHead, Response, - ResponseHead, + Error, Extensions, HttpMessage, Payload, PayloadStream, Request, RequestHead, + Response, ResponseHead, }; use actix_router::{Path, Resource, Url}; use futures::future::{ok, FutureResult, IntoFuture}; use crate::request::HttpRequest; -pub struct ServiceRequest

{ +pub struct ServiceRequest

{ req: HttpRequest, payload: Payload

, }