Struct ntex_service::dev::FnServiceConfig
source · [−]pub struct FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
F: Fn(Cfg) -> Fut,
Fut: Future<Output = Result<Srv, Err>>,
Srv: Service<Req>, { /* private fields */ }Expand description
Convert Fn(&Config) -> Future<Service> fn to NewService
Trait Implementations
sourceimpl<F, Fut, Cfg, Srv, Req, Err> Clone for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
F: Fn(Cfg) -> Fut + Clone,
Fut: Future<Output = Result<Srv, Err>>,
Srv: Service<Req>,
impl<F, Fut, Cfg, Srv, Req, Err> Clone for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
F: Fn(Cfg) -> Fut + Clone,
Fut: Future<Output = Result<Srv, Err>>,
Srv: Service<Req>,
sourceimpl<F, Fut, Cfg, Srv, Req, Err> ServiceFactory<Req, Cfg> for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
F: Fn(Cfg) -> Fut,
Fut: Future<Output = Result<Srv, Err>>,
Srv: Service<Req>,
impl<F, Fut, Cfg, Srv, Req, Err> ServiceFactory<Req, Cfg> for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
F: Fn(Cfg) -> Fut,
Fut: Future<Output = Result<Srv, Err>>,
Srv: Service<Req>,
type Service = Srv
type Service = Srv
The Service value created by this factory
type InitError = Err
type InitError = Err
Errors produced while building a service.
type Future = Fut
type Future = Fut
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<F, Fut, Cfg, Srv, Req, Err> RefUnwindSafe for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
Cfg: RefUnwindSafe,
Err: RefUnwindSafe,
F: RefUnwindSafe,
Fut: RefUnwindSafe,
Req: RefUnwindSafe,
Srv: RefUnwindSafe,
impl<F, Fut, Cfg, Srv, Req, Err> Send for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
Cfg: Send,
Err: Send,
F: Send,
Fut: Send,
Req: Send,
Srv: Send,
impl<F, Fut, Cfg, Srv, Req, Err> Sync for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
Cfg: Sync,
Err: Sync,
F: Sync,
Fut: Sync,
Req: Sync,
Srv: Sync,
impl<F, Fut, Cfg, Srv, Req, Err> Unpin for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
Cfg: Unpin,
Err: Unpin,
F: Unpin,
Fut: Unpin,
Req: Unpin,
Srv: Unpin,
impl<F, Fut, Cfg, Srv, Req, Err> UnwindSafe for FnServiceConfig<F, Fut, Cfg, Srv, Req, Err> where
Cfg: UnwindSafe,
Err: UnwindSafe,
F: UnwindSafe,
Fut: UnwindSafe,
Req: UnwindSafe,
Srv: 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