Struct ntex::service::PipelineFactory [−][src]
Pipeline factory
Implementations
impl<T> PipelineFactory<T> where
T: ServiceFactory,
[src]
T: ServiceFactory,
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
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = <T as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
F: IntoServiceFactory<U>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
[src]
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
U: ServiceFactory<Config = <T as ServiceFactory>::Config, Request = <T as ServiceFactory>::Response, Error = <T as ServiceFactory>::Error, InitError = <T as ServiceFactory>::InitError>,
F: IntoServiceFactory<U>,
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
Err: From<<T as ServiceFactory>::Error> + From<<U as ServiceFactory>::Error>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError>,
I: IntoServiceFactory<U>,
F: Fn(<T as ServiceFactory>::Response, &<U as ServiceFactory>::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
[src]
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
Err: From<<T as ServiceFactory>::Error> + From<<U as ServiceFactory>::Error>,
U: ServiceFactory<Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError>,
I: IntoServiceFactory<U>,
F: Fn(<T as ServiceFactory>::Response, &<U as ServiceFactory>::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
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 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
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>,
F: IntoServiceFactory<U>,
PipelineFactory<T>: Sized,
<T as ServiceFactory>::Config: Clone,
[src]
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
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>,
F: IntoServiceFactory<U>,
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,
[src]
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,
[src]
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,
[src]
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
impl<T> Clone for PipelineFactory<T> where
T: Clone,
[src]
T: Clone,
pub fn clone(&self) -> PipelineFactory<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> ServiceFactory for PipelineFactory<T> where
T: ServiceFactory,
[src]
T: ServiceFactory,
type Config = <T as ServiceFactory>::Config
Service factory configuration
type Request = <T as ServiceFactory>::Request
Requests handled by the service.
type Response = <T as ServiceFactory>::Response
Responses given by the service
type Error = <T as ServiceFactory>::Error
Errors produced by the service
type Service = <T as ServiceFactory>::Service
The Service
value created by this factory
type InitError = <T as ServiceFactory>::InitError
Errors produced while building a service.
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
[src]
&self,
cfg: <T as ServiceFactory>::Config
) -> <PipelineFactory<T> as ServiceFactory>::Future
pub fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R> where
F: FnMut(Self::Response) -> R + Clone,
[src]
F: FnMut(Self::Response) -> R + Clone,
pub fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E> where
F: Fn(Self::Error) -> E + Clone,
[src]
F: Fn(Self::Error) -> E + Clone,
pub fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
[src]
F: Fn(Self::InitError) -> E + Clone,
Auto Trait Implementations
impl<T> RefUnwindSafe for PipelineFactory<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PipelineFactory<T> where
T: Send,
T: Send,
impl<T> Sync for PipelineFactory<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PipelineFactory<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PipelineFactory<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoServiceFactory<T> for T where
T: ServiceFactory,
[src]
T: ServiceFactory,
pub fn into_factory(self) -> T
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,