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
Self: Sized,
C: Clone,
F: IntoServiceFactory<U, T::Response, C>,
U: ServiceFactory<T::Response, C, Error = T::Error, InitError = T::InitError>,
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<AndThenFactory<T, U, R, C>, R, C> where
Self: Sized,
C: Clone,
F: IntoServiceFactory<U, T::Response, C>,
U: ServiceFactory<T::Response, C, Error = T::Error, InitError = T::InitError>,
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::Service>,
pub fn apply<U>(
self,
tr: U
) -> PipelineFactory<ApplyTransform<U, T, R, C>, R, C> where
U: Transform<T::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
Self: Sized,
C: Clone,
F: IntoServiceFactory<U, Result<T::Response, T::Error>, C>,
U: ServiceFactory<Result<T::Response, T::Error>, C, Error = T::Error, InitError = T::InitError>,
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<ThenFactory<T, U, R>, R, C> where
Self: Sized,
C: Clone,
F: IntoServiceFactory<U, Result<T::Response, T::Error>, C>,
U: ServiceFactory<Result<T::Response, T::Error>, C, Error = T::Error, InitError = T::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 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
Self: Sized,
F: FnMut(T::Response) -> Res + Clone,
pub fn map<F, Res>(
self,
f: F
) -> PipelineFactory<MapServiceFactory<T, F, R, Res, C>, R, C> where
Self: Sized,
F: FnMut(T::Response) -> Res + Clone,
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
Self: Sized,
F: Fn(T::Error) -> E + Clone,
pub fn map_err<F, E>(
self,
f: F
) -> PipelineFactory<MapErrServiceFactory<T, R, C, F, E>, R, C> where
Self: Sized,
F: Fn(T::Error) -> E + Clone,
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
Self: Sized,
F: Fn(T::InitError) -> E + Clone,
pub fn map_init_err<F, E>(
self,
f: F
) -> PipelineFactory<MapInitErr<T, R, C, F, E>, R, C> where
Self: Sized,
F: Fn(T::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Trait Implementations
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
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, 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