[−][src]Struct actix_service::PipelineFactory
Pipeline factory
Implementations
impl<T: ServiceFactory> PipelineFactory<T>
[src]
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>,
[src]
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>,
[src]
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>,
[src]
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,
[src]
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,
[src]
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,
[src]
Self: Sized,
F: Fn(T::InitError) -> E + Clone,
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,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ServiceFactory> ServiceFactory for PipelineFactory<T>
[src]
type Config = T::Config
Service factory configuration.
type Request = T::Request
Requests handled by the created services.
type Response = T::Response
Responses given by the created services.
type Error = T::Error
Errors produced by the created services.
type Service = T::Service
The kind of Service
created by this factory.
type InitError = T::InitError
Errors potentially raised while building a service.
type Future = T::Future
The future of the Service
instance.
fn new_service(&self, cfg: T::Config) -> Self::Future
[src]
fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R> where
Self: Sized,
F: FnMut(Self::Response) -> R + Clone,
[src]
Self: Sized,
F: FnMut(Self::Response) -> R + Clone,
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E> where
Self: Sized,
F: Fn(Self::Error) -> E + Clone,
[src]
Self: Sized,
F: Fn(Self::Error) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
[src]
Self: Sized,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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,
fn into_factory(Self) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,