Struct actix_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::Request, Response = U::Response, Error = T::Error, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, Request = T::Response, Error = T::Error, InitError = T::InitError>,
pub fn and_then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = T::Request, Response = U::Response, Error = T::Error, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, Request = T::Response, Error = T::Error, InitError = T::InitError>,
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::Request, Response = Res, Error = Err, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = Res, Error = Err> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
I: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, InitError = T::InitError>,
F: FnMut(T::Response, &mut U::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
Err: From<T::Error> + From<U::Error>,
pub fn and_then_apply_fn<U, I, F, Fut, Res, Err>(
self,
factory: I,
f: F
) -> PipelineFactory<impl ServiceFactory<Request = T::Request, Response = Res, Error = Err, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = Res, Error = Err> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
I: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, InitError = T::InitError>,
F: FnMut(T::Response, &mut U::Service) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
Err: From<T::Error> + From<U::Error>,
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::Request, Response = U::Response, Error = T::Error, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, Request = Result<T::Response, T::Error>, Error = T::Error, InitError = T::InitError>,
pub fn then<F, U>(
self,
factory: F
) -> PipelineFactory<impl ServiceFactory<Request = T::Request, Response = U::Response, Error = T::Error, Config = T::Config, InitError = T::InitError, Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error> + Clone> + Clone> where
Self: Sized,
T::Config: Clone,
F: IntoServiceFactory<U>,
U: ServiceFactory<Config = T::Config, Request = Result<T::Response, T::Error>, 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, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>> where
Self: Sized,
F: FnMut(T::Response) -> R + Clone,
pub fn map<F, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>> where
Self: Sized,
F: FnMut(T::Response) -> R + 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, F, E>> where
Self: Sized,
F: Fn(T::Error) -> E + Clone,
pub fn map_err<F, E>(
self,
f: F
) -> PipelineFactory<MapErrServiceFactory<T, F, E>> 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, F, E>> where
Self: Sized,
F: Fn(T::InitError) -> E + Clone,
pub fn map_init_err<F, E>(self, f: F) -> PipelineFactory<MapInitErr<T, F, E>> 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 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
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, 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> 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