Struct actix_service::FnService
source · pub struct FnService<F, Req, Resp, E, Fut>where
F: Fn(Req) -> Fut,
Fut: IntoFuture<Item = Resp, Error = E>,{ /* private fields */ }
Implementations§
Trait Implementations§
source§impl<F, Req, Resp, E, Fut> Clone for FnService<F, Req, Resp, E, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = E>,
impl<F, Req, Resp, E, Fut> Clone for FnService<F, Req, Resp, E, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = E>,
source§impl<F, Req, Resp, Err, Fut> IntoService<FnService<F, Req, Resp, Err, Fut>, Req> for Fwhere
F: Fn(Req) -> Fut + 'static,
Fut: IntoFuture<Item = Resp, Error = Err>,
impl<F, Req, Resp, Err, Fut> IntoService<FnService<F, Req, Resp, Err, Fut>, Req> for Fwhere
F: Fn(Req) -> Fut + 'static,
Fut: IntoFuture<Item = Resp, Error = Err>,
source§fn into_service(self) -> FnService<F, Req, Resp, Err, Fut>
fn into_service(self) -> FnService<F, Req, Resp, Err, Fut>
Convert to a
Service
source§impl<F, Req, Resp, E, Fut> Service<Req> for FnService<F, Req, Resp, E, Fut>where
F: Fn(Req) -> Fut,
Fut: IntoFuture<Item = Resp, Error = E>,
impl<F, Req, Resp, E, Fut> Service<Req> for FnService<F, Req, Resp, E, Fut>where
F: Fn(Req) -> Fut,
Fut: IntoFuture<Item = Resp, Error = E>,
§type Future = <Fut as IntoFuture>::Future
type Future = <Fut as IntoFuture>::Future
The future response value.
source§fn poll_ready(&mut self) -> Poll<(), Self::Error>
fn poll_ready(&mut self) -> Poll<(), Self::Error>
Returns
Ready
when the service is able to process requests. Read moresource§fn call(&mut self, req: Req) -> Self::Future
fn call(&mut self, req: Req) -> Self::Future
Process the request and return the response asynchronously. Read more
source§fn apply<T, I, F, Out, Req>(
self,
service: I,
f: F
) -> AndThen<Self, Apply<T, F, Self::Response, Out, Req>>where
Self: Sized,
T: Service<Req, Error = Self::Error>,
I: IntoService<T, Req>,
F: Fn(Self::Response, &mut T) -> Out,
Out: IntoFuture<Error = Self::Error>,
fn apply<T, I, F, Out, Req>(
self,
service: I,
f: F
) -> AndThen<Self, Apply<T, F, Self::Response, Out, Req>>where
Self: Sized,
T: Service<Req, Error = Self::Error>,
I: IntoService<T, Req>,
F: Fn(Self::Response, &mut T) -> Out,
Out: IntoFuture<Error = Self::Error>,
Apply function to specified service and use it as a next service in
chain. Read more
source§fn and_then<F, B>(self, service: F) -> AndThen<Self, B>where
Self: Sized,
F: IntoService<B, Self::Response>,
B: Service<Self::Response, Error = Self::Error>,
fn and_then<F, B>(self, service: F) -> AndThen<Self, B>where
Self: Sized,
F: IntoService<B, Self::Response>,
B: Service<Self::Response, Error = Self::Error>,
Call another service after call to this one has resolved successfully. Read more
source§fn then<B>(self, service: B) -> Then<Self, B>where
Self: Sized,
B: Service<Result<Self::Response, Self::Error>, Error = Self::Error>,
fn then<B>(self, service: B) -> Then<Self, B>where
Self: Sized,
B: Service<Result<Self::Response, Self::Error>, Error = Self::Error>,
Chain on a computation for when a call to the service finished,
passing the result of the call to the next service
B
. Read moreAuto Trait Implementations§
impl<F, Req, Resp, E, Fut> RefUnwindSafe for FnService<F, Req, Resp, E, Fut>where
E: RefUnwindSafe,
F: RefUnwindSafe,
Req: RefUnwindSafe,
Resp: RefUnwindSafe,
impl<F, Req, Resp, E, Fut> Send for FnService<F, Req, Resp, E, Fut>where
E: Send,
F: Send,
Req: Send,
Resp: Send,
impl<F, Req, Resp, E, Fut> Sync for FnService<F, Req, Resp, E, Fut>where
E: Sync,
F: Sync,
Req: Sync,
Resp: Sync,
impl<F, Req, Resp, E, Fut> Unpin for FnService<F, Req, Resp, E, Fut>where
E: Unpin,
F: Unpin,
Req: Unpin,
Resp: Unpin,
impl<F, Req, Resp, E, Fut> UnwindSafe for FnService<F, Req, Resp, E, Fut>where
E: UnwindSafe,
F: UnwindSafe,
Req: UnwindSafe,
Resp: UnwindSafe,
Blanket Implementations§
source§impl<T, Request> IntoService<T, Request> for Twhere
T: Service<Request>,
impl<T, Request> IntoService<T, Request> for Twhere
T: Service<Request>,
source§fn into_service(self) -> T
fn into_service(self) -> T
Convert to a
Service