Struct ntex::service::PipelineFactory [−][src]
pub struct PipelineFactory<T, R, C = ()> { /* fields omitted */ }
Expand description
Pipeline factory
Implementations
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<AndThenFactory<T, U, R, C>, R, C> where
C: Clone,
F: IntoServiceFactory<U, <T as ServiceFactory<R, C>>::Response, C>,
U: ServiceFactory<<T as ServiceFactory<R, C>>::Response, C, Error = <T as ServiceFactory<R, C>>::Error, InitError = <T as ServiceFactory<R, C>>::InitError>,
PipelineFactory<T, R, C>: Sized,
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<AndThenFactory<T, U, R, C>, R, C> where
C: Clone,
F: IntoServiceFactory<U, <T as ServiceFactory<R, C>>::Response, C>,
U: ServiceFactory<<T as ServiceFactory<R, C>>::Response, C, Error = <T as ServiceFactory<R, C>>::Error, InitError = <T as ServiceFactory<R, C>>::InitError>,
PipelineFactory<T, R, C>: Sized,
Call another service after call to this one has resolved successfully.
pub fn apply<U>(
self,
tr: U
) -> PipelineFactory<ApplyTransform<U, T, R, C>, R, C> where
U: Transform<<T as ServiceFactory<R, C>>::Service>,
pub fn apply<U>(
self,
tr: U
) -> PipelineFactory<ApplyTransform<U, T, R, C>, R, C> where
U: Transform<<T as ServiceFactory<R, C>>::Service>,
Apply transform to current service factory.
Short version of apply(transform, pipeline_factory(...))
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<ThenFactory<T, U, R>, R, C> where
C: Clone,
F: IntoServiceFactory<U, Result<<T as ServiceFactory<R, C>>::Response, <T as ServiceFactory<R, C>>::Error>, C>,
U: ServiceFactory<Result<<T as ServiceFactory<R, C>>::Response, <T as ServiceFactory<R, C>>::Error>, C, Error = <T as ServiceFactory<R, C>>::Error, InitError = <T as ServiceFactory<R, C>>::InitError>,
PipelineFactory<T, R, C>: Sized,
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<ThenFactory<T, U, R>, R, C> where
C: Clone,
F: IntoServiceFactory<U, Result<<T as ServiceFactory<R, C>>::Response, <T as ServiceFactory<R, C>>::Error>, C>,
U: ServiceFactory<Result<<T as ServiceFactory<R, C>>::Response, <T as ServiceFactory<R, C>>::Error>, C, Error = <T as ServiceFactory<R, C>>::Error, InitError = <T as ServiceFactory<R, C>>::InitError>,
PipelineFactory<T, R, C>: Sized,
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 U
.
Note that this function consumes the receiving pipeline and returns a wrapped version of it.
pub fn map<F, Res>(
self,
f: F
) -> PipelineFactory<MapServiceFactory<T, F, R, Res, C>, R, C> where
F: FnMut(<T as ServiceFactory<R, C>>::Response) -> Res + Clone,
PipelineFactory<T, R, C>: Sized,
pub fn map<F, Res>(
self,
f: F
) -> PipelineFactory<MapServiceFactory<T, F, R, Res, C>, R, C> where
F: FnMut(<T as ServiceFactory<R, C>>::Response) -> Res + Clone,
PipelineFactory<T, R, C>: Sized,
Map this service’s output to a different type, returning a new service of the resulting type.
pub fn map_err<F, E>(
self,
f: F
) -> PipelineFactory<MapErrServiceFactory<T, R, C, F, E>, R, C> where
F: Fn(<T as ServiceFactory<R, C>>::Error) -> E + Clone,
PipelineFactory<T, R, C>: Sized,
pub fn map_err<F, E>(
self,
f: F
) -> PipelineFactory<MapErrServiceFactory<T, R, C, F, E>, R, C> where
F: Fn(<T as ServiceFactory<R, C>>::Error) -> E + Clone,
PipelineFactory<T, R, C>: Sized,
Map this service’s error to a different error, returning a new service.
pub fn map_init_err<F, E>(
self,
f: F
) -> PipelineFactory<MapInitErr<T, R, C, F, E>, R, C> where
F: Fn(<T as ServiceFactory<R, C>>::InitError) -> E + Clone,
PipelineFactory<T, R, C>: Sized,
pub fn map_init_err<F, E>(
self,
f: F
) -> PipelineFactory<MapInitErr<T, R, C, F, E>, R, C> where
F: Fn(<T as ServiceFactory<R, C>>::InitError) -> E + Clone,
PipelineFactory<T, R, C>: Sized,
Map this factory’s init error to a different error, returning a new service.
Trait Implementations
type Response = <T as ServiceFactory<R, C>>::Response
type Response = <T as ServiceFactory<R, C>>::Response
Responses given by the service
type Error = <T as ServiceFactory<R, C>>::Error
type Error = <T as ServiceFactory<R, C>>::Error
Errors produced by the service
type Service = <T as ServiceFactory<R, C>>::Service
type Service = <T as ServiceFactory<R, C>>::Service
The Service
value created by this factory
type InitError = <T as ServiceFactory<R, C>>::InitError
type InitError = <T as ServiceFactory<R, C>>::InitError
Errors produced while building a service.
type Future = <T as ServiceFactory<R, C>>::Future
type Future = <T as ServiceFactory<R, C>>::Future
The future of the ServiceFactory
instance.
pub fn new_service(
&self,
cfg: C
) -> <PipelineFactory<T, R, C> as ServiceFactory<R, C>>::Future
pub fn new_service(
&self,
cfg: C
) -> <PipelineFactory<T, R, C> as ServiceFactory<R, C>>::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, Req, Cfg, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, 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<T, R, C> RefUnwindSafe for PipelineFactory<T, R, C> where
C: RefUnwindSafe,
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R, C> Send for PipelineFactory<T, R, C> where
C: Send,
R: Send,
T: Send,
impl<T, R, C> Sync for PipelineFactory<T, R, C> where
C: Sync,
R: Sync,
T: Sync,
impl<T, R, C> Unpin for PipelineFactory<T, R, C> where
C: Unpin,
R: Unpin,
T: Unpin,
impl<T, R, C> UnwindSafe for PipelineFactory<T, R, C> where
C: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Self
to a ServiceFactory
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more