[][src]Struct ntex::service::PipelineFactory

pub struct PipelineFactory<T> { /* fields omitted */ }

Pipeline factory

Methods

impl<T> PipelineFactory<T> where
    T: ServiceFactory
[src]

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
[src]

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>,
    F: Fn(<T as ServiceFactory>::Response, &<U as ServiceFactory>::Service) -> Fut + Clone,
    Fut: Future<Output = Result<Res, Err>>,
    I: IntoServiceFactory<U>,
    U: ServiceFactory<Config = <T as ServiceFactory>::Config, InitError = <T as ServiceFactory>::InitError>,
    PipelineFactory<T>: Sized,
    <T as ServiceFactory>::Config: Clone
[src]

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
    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
[src]

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]

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]

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]

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]

impl<T> ServiceFactory for PipelineFactory<T> where
    T: ServiceFactory
[src]

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 Service instance.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoServiceFactory<T> for T where
    T: ServiceFactory
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,