Struct actix_service::PipelineFactory[][src]

pub struct PipelineFactory<SF, Req> { /* fields omitted */ }

Pipeline factory

Implementations

impl<SF, Req> PipelineFactory<SF, Req> where
    SF: ServiceFactory<Req>, 
[src]

pub fn and_then<I, SF1>(
    self,
    factory: I
) -> PipelineFactory<impl ServiceFactory<Req, Response = SF1::Response, Error = SF::Error, Config = SF::Config, InitError = SF::InitError, Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone> + Clone, Req> where
    Self: Sized,
    SF::Config: Clone,
    I: IntoServiceFactory<SF1, SF::Response>,
    SF1: ServiceFactory<SF::Response, Config = SF::Config, Error = SF::Error, InitError = SF::InitError>, 
[src]

Call another service after call to this one has resolved successfully.

pub fn then<I, SF1>(
    self,
    factory: I
) -> PipelineFactory<impl ServiceFactory<Req, Response = SF1::Response, Error = SF::Error, Config = SF::Config, InitError = SF::InitError, Service = impl Service<Req, Response = SF1::Response, Error = SF::Error> + Clone> + Clone, Req> where
    Self: Sized,
    SF::Config: Clone,
    I: IntoServiceFactory<SF1, Result<SF::Response, SF::Error>>,
    SF1: ServiceFactory<Result<SF::Response, SF::Error>, Config = SF::Config, Error = SF::Error, InitError = SF::InitError>, 
[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<SF, F, Req, R>, Req> where
    Self: Sized,
    F: FnMut(SF::Response) -> R + Clone
[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<SF, Req, F, E>, Req> where
    Self: Sized,
    F: Fn(SF::Error) -> E + Clone
[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<SF, F, Req, E>, Req> where
    Self: Sized,
    F: Fn(SF::InitError) -> E + Clone
[src]

Map this factory's init error to a different error, returning a new service.

Trait Implementations

impl<T, Req> Clone for PipelineFactory<T, Req> where
    T: Clone
[src]

impl<SF, Req> ServiceFactory<Req> for PipelineFactory<SF, Req> where
    SF: ServiceFactory<Req>, 
[src]

type Config = SF::Config

Service factory configuration.

type Response = SF::Response

Responses given by the created services.

type Error = SF::Error

Errors produced by the created services.

type Service = SF::Service

The kind of Service created by this factory.

type InitError = SF::InitError

Errors potentially raised while building a service.

type Future = SF::Future

The future of the Service instance.

Auto Trait Implementations

impl<SF, Req> Send for PipelineFactory<SF, Req> where
    Req: Send,
    SF: Send
[src]

impl<SF, Req> Sync for PipelineFactory<SF, Req> where
    Req: Sync,
    SF: Sync
[src]

impl<SF, Req> Unpin for PipelineFactory<SF, Req> where
    Req: Unpin,
    SF: Unpin
[src]

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<SF, Req> IntoServiceFactory<SF, Req> for SF where
    SF: ServiceFactory<Req>, 
[src]

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.