pub struct PipelineFactory<T> { /* private fields */ }Expand description
Pipeline factory
Implementations§
Source§impl<T: ServiceFactory> PipelineFactory<T>
impl<T: ServiceFactory> PipelineFactory<T>
Sourcepub 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.
Sourcepub 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>
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>
Apply function to specified service and use it as a next service in chain.
Short version of pipeline_factory(...).and_then(apply_fn_factory(...))
Sourcepub 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>
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>
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.
Sourcepub fn map<F, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>>
pub fn map<F, R>(self, f: F) -> PipelineFactory<MapServiceFactory<T, F, R>>
Map this service’s output to a different type, returning a new service of the resulting type.
Sourcepub fn map_err<F, E>(
self,
f: F,
) -> PipelineFactory<MapErrServiceFactory<T, F, E>>
pub fn map_err<F, E>( self, f: F, ) -> PipelineFactory<MapErrServiceFactory<T, F, E>>
Map this service’s error to a different error, returning a new service.
Sourcepub fn map_init_err<F, E>(self, f: F) -> PipelineFactory<MapInitErr<T, F, E>>
pub fn map_init_err<F, E>(self, f: F) -> PipelineFactory<MapInitErr<T, F, E>>
Map this factory’s init error to a different error, returning a new service.
Trait Implementations§
Source§impl<T> Clone for PipelineFactory<T>where
T: Clone,
impl<T> Clone for PipelineFactory<T>where
T: Clone,
Source§impl<T: ServiceFactory> ServiceFactory for PipelineFactory<T>
impl<T: ServiceFactory> ServiceFactory for PipelineFactory<T>
Source§type Config = <T as ServiceFactory>::Config
type Config = <T as ServiceFactory>::Config
Service factory configuration
Source§type Request = <T as ServiceFactory>::Request
type Request = <T as ServiceFactory>::Request
Requests handled by the service.
Source§type Response = <T as ServiceFactory>::Response
type Response = <T as ServiceFactory>::Response
Responses given by the service
Source§type Error = <T as ServiceFactory>::Error
type Error = <T as ServiceFactory>::Error
Errors produced by the service
Source§type Service = <T as ServiceFactory>::Service
type Service = <T as ServiceFactory>::Service
The
Service value created by this factorySource§type InitError = <T as ServiceFactory>::InitError
type InitError = <T as ServiceFactory>::InitError
Errors produced while building a service.
Source§type Future = <T as ServiceFactory>::Future
type Future = <T as ServiceFactory>::Future
The future of the
Service instance.Source§fn new_service(&self, cfg: T::Config) -> Self::Future
fn new_service(&self, cfg: T::Config) -> Self::Future
Create and return a new service value asynchronously.
Source§fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
Map this service’s output to a different type, returning a new service
of the resulting type.
Source§fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E>
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E>
Map this service’s error to a different error, returning a new service.
Source§fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<T> Freeze for PipelineFactory<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
Source§fn into_factory(self) -> T
fn into_factory(self) -> T
Convert
Self to a ServiceFactory