Struct actix_web_lab::middleware::MiddlewareFn
source · pub struct MiddlewareFn<F, Es> { /* private fields */ }
Expand description
Middleware transform for from_fn
.
Trait Implementations§
source§impl<S, F, Fut, B, B2> Transform<S, ServiceRequest> for MiddlewareFn<F, ()>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(ServiceRequest, Next<B>) -> Fut + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>>,
B2: MessageBody,
impl<S, F, Fut, B, B2> Transform<S, ServiceRequest> for MiddlewareFn<F, ()>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(ServiceRequest, Next<B>) -> Fut + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>>, B2: MessageBody,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Future = Ready<Result<<MiddlewareFn<F, ()> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, ()> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, ()> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, ()> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1,)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1,)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1,)>
type Transform = MiddlewareFnService<F, B, (E1,)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1,)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1,)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1,)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1,)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2)>
type Transform = MiddlewareFnService<F, B, (E1, E2)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, E5, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
E5: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, E5, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, E5: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, E5, E6, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
E5: FromRequest + 'static,
E6: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, E5, E6, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, E5: FromRequest + 'static, E6: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, E5, E6, E7, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
E5: FromRequest + 'static,
E6: FromRequest + 'static,
E7: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, E5, E6, E7, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, E5: FromRequest + 'static, E6: FromRequest + 'static, E7: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7, E8> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, E5, E6, E7, E8, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
E5: FromRequest + 'static,
E6: FromRequest + 'static,
E7: FromRequest + 'static,
E8: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7, E8> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, E5, E6, E7, E8, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, E5: FromRequest + 'static, E6: FromRequest + 'static, E7: FromRequest + 'static, E8: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7, E8)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7, E8)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
source§impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7, E8, E9> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
F: Fn(E1, E2, E3, E4, E5, E6, E7, E8, E9, ServiceRequest, Next<B>) -> Fut + 'static,
E1: FromRequest + 'static,
E2: FromRequest + 'static,
E3: FromRequest + 'static,
E4: FromRequest + 'static,
E5: FromRequest + 'static,
E6: FromRequest + 'static,
E7: FromRequest + 'static,
E8: FromRequest + 'static,
E9: FromRequest + 'static,
Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static,
B: MessageBody + 'static,
B2: MessageBody + 'static,
impl<S, F, Fut, B, B2, E1, E2, E3, E4, E5, E6, E7, E8, E9> Transform<S, ServiceRequest> for MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>where S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static, F: Fn(E1, E2, E3, E4, E5, E6, E7, E8, E9, ServiceRequest, Next<B>) -> Fut + 'static, E1: FromRequest + 'static, E2: FromRequest + 'static, E3: FromRequest + 'static, E4: FromRequest + 'static, E5: FromRequest + 'static, E6: FromRequest + 'static, E7: FromRequest + 'static, E8: FromRequest + 'static, E9: FromRequest + 'static, Fut: Future<Output = Result<ServiceResponse<B2>, Error>> + 'static, B: MessageBody + 'static, B2: MessageBody + 'static,
§type Response = ServiceResponse<B2>
type Response = ServiceResponse<B2>
Responses produced by the service.
§type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>
type Transform = MiddlewareFnService<F, B, (E1, E2, E3, E4, E5, E6, E7, E8, E9)>
The
TransformService
value created by this factory§type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)> as Transform<S, ServiceRequest>>::Transform, <MiddlewareFn<F, (E1, E2, E3, E4, E5, E6, E7, E8, E9)> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl<F, Es> RefUnwindSafe for MiddlewareFn<F, Es>where Es: RefUnwindSafe, F: RefUnwindSafe,
impl<F, Es> !Send for MiddlewareFn<F, Es>
impl<F, Es> !Sync for MiddlewareFn<F, Es>
impl<F, Es> Unpin for MiddlewareFn<F, Es>where Es: Unpin,
impl<F, Es> UnwindSafe for MiddlewareFn<F, Es>where Es: UnwindSafe, F: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more