Struct actix_net::service::FnNewService
source · pub struct FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut,
Fut: IntoFuture<Item = Resp, Error = Err>,{ /* private fields */ }
Implementations§
source§impl<F, Req, Resp, Err, Fut> FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
impl<F, Req, Resp, Err, Fut> FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
Trait Implementations§
source§impl<F, Req, Resp, Err, Fut> Clone for FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
impl<F, Req, Resp, Err, Fut> Clone for FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
source§impl<F, Req, Resp, Err, Fut> IntoNewService<FnNewService<F, Req, Resp, Err, Fut>> for Fwhere
F: Fn(Req) -> Fut + Clone + 'static,
Fut: IntoFuture<Item = Resp, Error = Err>,
impl<F, Req, Resp, Err, Fut> IntoNewService<FnNewService<F, Req, Resp, Err, Fut>> for Fwhere
F: Fn(Req) -> Fut + Clone + 'static,
Fut: IntoFuture<Item = Resp, Error = Err>,
source§fn into_new_service(self) -> FnNewService<F, Req, Resp, Err, Fut>
fn into_new_service(self) -> FnNewService<F, Req, Resp, Err, Fut>
Convert to an
NewService
source§impl<F, Req, Resp, Err, Fut> NewService for FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
impl<F, Req, Resp, Err, Fut> NewService for FnNewService<F, Req, Resp, Err, Fut>where
F: Fn(Req) -> Fut + Clone,
Fut: IntoFuture<Item = Resp, Error = Err>,
§type Future = FutureResult<<FnNewService<F, Req, Resp, Err, Fut> as NewService>::Service, <FnNewService<F, Req, Resp, Err, Fut> as NewService>::InitError>
type Future = FutureResult<<FnNewService<F, Req, Resp, Err, Fut> as NewService>::Service, <FnNewService<F, Req, Resp, Err, Fut> as NewService>::InitError>
The future of the
Service
instance.source§fn new_service(&self) -> Self::Future
fn new_service(&self) -> Self::Future
Create and return a new service value asynchronously.
Auto Trait Implementations§
impl<F, Req, Resp, Err, Fut> RefUnwindSafe for FnNewService<F, Req, Resp, Err, Fut>where
Err: RefUnwindSafe,
F: RefUnwindSafe,
Req: RefUnwindSafe,
Resp: RefUnwindSafe,
impl<F, Req, Resp, Err, Fut> Send for FnNewService<F, Req, Resp, Err, Fut>where
Err: Send,
F: Send,
Req: Send,
Resp: Send,
impl<F, Req, Resp, Err, Fut> Sync for FnNewService<F, Req, Resp, Err, Fut>where
Err: Sync,
F: Sync,
Req: Sync,
Resp: Sync,
impl<F, Req, Resp, Err, Fut> Unpin for FnNewService<F, Req, Resp, Err, Fut>where
Err: Unpin,
F: Unpin,
Req: Unpin,
Resp: Unpin,
impl<F, Req, Resp, Err, Fut> UnwindSafe for FnNewService<F, Req, Resp, Err, Fut>where
Err: UnwindSafe,
F: UnwindSafe,
Req: UnwindSafe,
Resp: UnwindSafe,
Blanket Implementations§
source§impl<T> IntoNewService<T> for Twhere
T: NewService,
impl<T> IntoNewService<T> for Twhere
T: NewService,
source§fn into_new_service(self) -> T
fn into_new_service(self) -> T
Convert to an
NewService
source§impl<T> NewServiceExt for Twhere
T: NewService + ?Sized,
impl<T> NewServiceExt for Twhere
T: NewService + ?Sized,
fn apply<S, I, F, R>(
self,
service: I,
f: F
) -> AndThenNewService<Self, ApplyNewService<S, F, R, Self::Response>>where
Self: Sized,
S: NewService<InitError = Self::InitError>,
S::Error: Into<<R::Future as Future>::Error>,
I: IntoNewService<S>,
F: Fn(Self::Response, &mut S::Service) -> R + Clone,
R: IntoFuture<Error = Self::Error>,
fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B>,
B: NewService<Request = Self::Response, Error = Self::Error, InitError = Self::InitError>,
source§fn from_err<E>(self) -> FromErrNewService<Self, E>where
Self: Sized,
E: From<Self::Error>,
fn from_err<E>(self) -> FromErrNewService<Self, E>where
Self: Sized,
E: From<Self::Error>,
NewService
that create service to map this service’s error
and new service’s init error to any error
implementing From
for this services
Error`. Read moresource§fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B>,
B: NewService<Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>,
fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B>,
B: NewService<Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>,
Create
NewService
to chain on a computation for when a call to the
service finished, passing the result of the call to the next
service B
. Read more