Struct ntex_service::dev::ApplyServiceFactory
source · [−]pub struct ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
T: ServiceFactory<Req, Cfg, Error = Err>,
F: Fn(In, &T::Service) -> R + Clone,
R: Future<Output = Result<Out, Err>>, { /* private fields */ }Expand description
apply() service factory
Trait Implementations
sourceimpl<T, Req, Cfg, F, R, In, Out, Err> Clone for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
T: ServiceFactory<Req, Cfg, Error = Err> + Clone,
F: Fn(In, &T::Service) -> R + Clone,
R: Future<Output = Result<Out, Err>>,
impl<T, Req, Cfg, F, R, In, Out, Err> Clone for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
T: ServiceFactory<Req, Cfg, Error = Err> + Clone,
F: Fn(In, &T::Service) -> R + Clone,
R: Future<Output = Result<Out, Err>>,
sourceimpl<T, Req, Cfg, F, R, In, Out, Err> ServiceFactory<In, Cfg> for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
T: ServiceFactory<Req, Cfg, Error = Err>,
F: Fn(In, &T::Service) -> R + Clone,
R: Future<Output = Result<Out, Err>>,
impl<T, Req, Cfg, F, R, In, Out, Err> ServiceFactory<In, Cfg> for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
T: ServiceFactory<Req, Cfg, Error = Err>,
F: Fn(In, &T::Service) -> R + Clone,
R: Future<Output = Result<Out, Err>>,
type Response = Out
type Response = Out
Responses given by the service
type Error = Err
type Error = Err
Errors produced by the service
type Service = Apply<<T as ServiceFactory<Req, Cfg>>::Service, Req, F, R, In, Out, Err>
type Service = Apply<<T as ServiceFactory<Req, Cfg>>::Service, Req, F, R, In, Out, Err>
The Service value created by this factory
type InitError = <T as ServiceFactory<Req, Cfg>>::InitError
type InitError = <T as ServiceFactory<Req, Cfg>>::InitError
Errors produced while building a service.
type Future = ApplyServiceFactoryResponse<T, Req, Cfg, F, R, In, Out, Err>
type Future = ApplyServiceFactoryResponse<T, Req, Cfg, F, R, In, Out, Err>
The future of the ServiceFactory instance.
sourcefn new_service(&self, cfg: Cfg) -> Self::Future
fn new_service(&self, cfg: Cfg) -> Self::Future
Create and return a new service value asynchronously.
sourcefn map<F, Res>(self, f: F) -> MapServiceFactory<Self, F, Req, Res, Cfg> where
Self: Sized,
F: FnMut(Self::Response) -> Res + Clone,
fn map<F, Res>(self, f: F) -> MapServiceFactory<Self, F, Req, Res, Cfg> where
Self: Sized,
F: FnMut(Self::Response) -> Res + Clone,
Map this service’s output to a different type, returning a new service of the resulting type. Read more
sourcefn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, Req, Cfg, F, E> where
Self: Sized,
F: Fn(Self::Error) -> E + Clone,
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, Req, Cfg, F, E> where
Self: Sized,
F: Fn(Self::Error) -> E + Clone,
Map this service’s error to a different error, returning a new service.
sourcefn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<T, Req, Cfg, F, R, In, Out, Err> RefUnwindSafe for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Req, Cfg, F, R, In, Out, Err> Send for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
F: Send,
T: Send,
impl<T, Req, Cfg, F, R, In, Out, Err> Sync for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
F: Sync,
T: Sync,
impl<T, Req, Cfg, F, R, In, Out, Err> Unpin for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
F: Unpin,
T: Unpin,
impl<T, Req, Cfg, F, R, In, Out, Err> UnwindSafe for ApplyServiceFactory<T, Req, Cfg, F, R, In, Out, Err> where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for T where
T: ServiceFactory<Req, Cfg>,
impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for T where
T: ServiceFactory<Req, Cfg>,
sourcefn into_factory(self) -> T
fn into_factory(self) -> T
Convert Self to a ServiceFactory