Struct ntex::service::dev::MapErrServiceFactory [−][src]
pub struct MapErrServiceFactory<A, F, E> where
F: Fn(<A as ServiceFactory>::Error) -> E + Clone,
A: ServiceFactory, { /* fields omitted */ }
Expand description
Factory for the map_err
combinator, changing the type of a new
service’s error.
This is created by the NewServiceExt::map_err
method.
Trait Implementations
impl<A, F, E> Clone for MapErrServiceFactory<A, F, E> where
F: Fn(<A as ServiceFactory>::Error) -> E + Clone,
A: ServiceFactory + Clone,
impl<A, F, E> Clone for MapErrServiceFactory<A, F, E> where
F: Fn(<A as ServiceFactory>::Error) -> E + Clone,
A: ServiceFactory + Clone,
impl<A, F, E> ServiceFactory for MapErrServiceFactory<A, F, E> where
F: Fn(<A as ServiceFactory>::Error) -> E + Clone,
A: ServiceFactory,
impl<A, F, E> ServiceFactory for MapErrServiceFactory<A, F, E> where
F: Fn(<A as ServiceFactory>::Error) -> E + Clone,
A: ServiceFactory,
type Request = <A as ServiceFactory>::Request
type Request = <A as ServiceFactory>::Request
Requests handled by the service.
type Response = <A as ServiceFactory>::Response
type Response = <A as ServiceFactory>::Response
Responses given by the service
type Error = E
type Error = E
Errors produced by the service
type Config = <A as ServiceFactory>::Config
type Config = <A as ServiceFactory>::Config
Service factory configuration
type Service = MapErr<<A as ServiceFactory>::Service, F, E>
type Service = MapErr<<A as ServiceFactory>::Service, F, E>
The Service
value created by this factory
type InitError = <A as ServiceFactory>::InitError
type InitError = <A as ServiceFactory>::InitError
Errors produced while building a service.
type Future = MapErrServiceFuture<A, F, E>
type Future = MapErrServiceFuture<A, F, E>
The future of the ServiceFactory
instance.
pub fn new_service(
&self,
cfg: <A as ServiceFactory>::Config
) -> <MapErrServiceFactory<A, F, E> as ServiceFactory>::Future
pub fn new_service(
&self,
cfg: <A as ServiceFactory>::Config
) -> <MapErrServiceFactory<A, F, E> as ServiceFactory>::Future
Create and return a new service value asynchronously.
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Map this service’s error to a different error, returning a new service.
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<A, F, E> RefUnwindSafe for MapErrServiceFactory<A, F, E> where
A: RefUnwindSafe,
E: RefUnwindSafe,
F: RefUnwindSafe,
impl<A, F, E> Send for MapErrServiceFactory<A, F, E> where
A: Send,
E: Send,
F: Send,
impl<A, F, E> Sync for MapErrServiceFactory<A, F, E> where
A: Sync,
E: Sync,
F: Sync,
impl<A, F, E> Unpin for MapErrServiceFactory<A, F, E> where
A: Unpin,
E: Unpin,
F: Unpin,
impl<A, F, E> UnwindSafe for MapErrServiceFactory<A, F, E> where
A: UnwindSafe,
E: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Convert Self
to a ServiceFactory