Struct ntex::service::PipelineFactory [−][src]
pub struct PipelineFactory<T> { /* fields omitted */ }
Expand description
Pipeline factory
Implementations
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error> + Clone> + Clone> where
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = <T as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error> + Clone> + Clone> where
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = <T as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
Call another service after call to this one has resolved successfully.
pub fn and_then_apply_fn<U, I, F, Fut, Res, Err>(
self,
factory: I,
f: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = Res, Error = Err, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = Res, Error = Err> + Clone> + Clone> where
I: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError>,
F: Fn(<T as ServiceFactory>::Response, &<U as ServiceFactory>::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
Err: From<<T as ServiceFactory>::Error> + From<<U as ServiceFactory>::Error>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
pub fn and_then_apply_fn<U, I, F, Fut, Res, Err>(
self,
factory: I,
f: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = Res, Error = Err, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = Res, Error = Err> + Clone> + Clone> where
I: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError>,
F: Fn(<T as ServiceFactory>::Response, &<U as ServiceFactory>::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
Err: From<<T as ServiceFactory>::Error> + From<<U as ServiceFactory>::Error>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
Apply function to specified service and use it as a next service in chain.
Short version of pipeline_factory(...).and_then(apply_fn_factory(...))
pub fn apply<U>(self, tr: U) -> PipelineFactory<ApplyTransform<U, T>> where
U: Transform<<T as ServiceFactory>::Service>,
pub fn apply<U>(self, tr: U) -> PipelineFactory<ApplyTransform<U, T>> where
U: Transform<<T as ServiceFactory>::Service>,
Apply transform to current service factory.
Short version of apply(transform, pipeline_factory(...))
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error> + Clone> + Clone> where
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = Result<<T as ServiceFactory>::Response, <T as ServiceFactory>::Error>, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError, Service = impl Service<Request = <T as ServiceFactory>::Request, Response = <U as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error> + Clone> + Clone> where
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = Result<<T as ServiceFactory>::Response, <T as ServiceFactory>::Error>, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
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, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>> where
F: FnMut(<T as ServiceFactory>::Response) -> R + Clone,
PipelineFactory<T>: Sized,
pub fn map<F, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>> where
F: FnMut(<T as ServiceFactory>::Response) -> R + Clone,
PipelineFactory<T>: 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, F, E>> where
F: Fn(<T as ServiceFactory>::Error) -> E + Clone,
PipelineFactory<T>: Sized,
pub fn map_err<F, E>(
self,
f: F
) -> PipelineFactory<MapErrServiceFactory<T, F, E>> where
F: Fn(<T as ServiceFactory>::Error) -> E + Clone,
PipelineFactory<T>: 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, F, E>> where
F: Fn(<T as ServiceFactory>::InitError) -> E + Clone,
PipelineFactory<T>: Sized,
pub fn map_init_err<F, E>(self, f: F) -> PipelineFactory<MapInitErr<T, F, E>> where
F: Fn(<T as ServiceFactory>::InitError) -> E + Clone,
PipelineFactory<T>: Sized,
Map this factory’s init error to a different error, returning a new service.
Trait Implementations
type Config = <T as ServiceFactory>::Config
type Config = <T as ServiceFactory>::Config
Service factory configuration
type Request = <T as ServiceFactory>::Request
type Request = <T as ServiceFactory>::Request
Requests handled by the service.
type Response = <T as ServiceFactory>::Response
type Response = <T as ServiceFactory>::Response
Responses given by the service
type Error = <T as ServiceFactory>::Error
type Error = <T as ServiceFactory>::Error
Errors produced by the service
type Service = <T as ServiceFactory>::Service
type Service = <T as ServiceFactory>::Service
The Service
value created by this factory
type InitError = <T as ServiceFactory>::InitError
type InitError = <T as ServiceFactory>::InitError
Errors produced while building a service.
type Future = <T as ServiceFactory>::Future
type Future = <T as ServiceFactory>::Future
The future of the ServiceFactory
instance.
pub fn new_service(
&self,
cfg: <T as ServiceFactory>::Config
) -> <PipelineFactory<T> as ServiceFactory>::Future
pub fn new_service(
&self,
cfg: <T as ServiceFactory>::Config
) -> <PipelineFactory<T> 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<T> RefUnwindSafe for PipelineFactory<T> where
T: RefUnwindSafe,
impl<T> Send for PipelineFactory<T> where
T: Send,
impl<T> Sync for PipelineFactory<T> where
T: Sync,
impl<T> Unpin for PipelineFactory<T> where
T: Unpin,
impl<T> UnwindSafe for PipelineFactory<T> where
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