[][src]Trait actix_service::NewService

pub trait NewService {
    type Request;
    type Response;
    type Error;
    type Config;
    type Service: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>;
    type InitError;
    type Future: Future<Item = Self::Service, Error = Self::InitError>;
    fn new_service(&self, cfg: &Self::Config) -> Self::Future;

    fn apply<T, T1, B, B1>(
        self,
        transform: T1,
        service: B1
    ) -> AndThenTransform<T, Self, B>
    where
        Self: Sized,
        T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
        T::Error: From<Self::Error>,
        T1: IntoTransform<T, B::Service>,
        B: NewService<Config = Self::Config, InitError = Self::InitError>,
        B1: IntoNewService<B>
, { ... }
fn apply_fn<B, I, F, Out>(
        self,
        service: I,
        f: F
    ) -> AndThenApplyNewService<Self, B, F, Out>
    where
        Self: Sized,
        B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
        I: IntoNewService<B>,
        F: FnMut(Self::Response, &mut B::Service) -> Out,
        Out: IntoFuture,
        Out::Error: Into<Self::Error>
, { ... }
fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B>
    where
        Self: Sized,
        F: IntoNewService<B>,
        B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>
, { ... }
fn from_err<E>(self) -> FromErrNewService<Self, E>
    where
        Self: Sized,
        E: From<Self::Error>
, { ... }
fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B>
    where
        Self: Sized,
        F: IntoNewService<B>,
        B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>
, { ... }
fn map<F, R>(self, f: F) -> MapNewService<Self, F, R>
    where
        Self: Sized,
        F: FnMut(Self::Response) -> R
, { ... }
fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E>
    where
        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
, { ... }
fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C>
    where
        Self: Sized,
        F: Fn(&C) -> MappedConfig<Self::Config>
, { ... }
fn unit_config<C>(self) -> UnitConfig<Self, C>
    where
        Self: NewService<Config = ()> + Sized
, { ... } }

Creates new Service values.

Acts as a service factory. This is useful for cases where new Service values must be produced. One case is a TCP servier listener. The listner accepts new TCP streams, obtains a new Service value using the NewService trait, and uses that new Service value to process inbound requests on that new TCP stream.

Config is a service factory configuration type.

Associated Types

type Request

Requests handled by the service.

type Response

Responses given by the service

type Error

Errors produced by the service

type Config

Service factory configuration

type Service: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>

The Service value created by this factory

type InitError

Errors produced while building a service.

type Future: Future<Item = Self::Service, Error = Self::InitError>

The future of the Service instance.

Loading content...

Required methods

fn new_service(&self, cfg: &Self::Config) -> Self::Future

Create and return a new service value asynchronously.

Loading content...

Provided methods

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 

Apply transform service to specified service and use it as a next service in chain.

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 

Apply function to specified service and use it as a next service in chain.

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 

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

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 

NewService that create service to map this service's error and new service's init error to any error implementing From for this services Error`.

Note that this function consumes the receiving new service and returns a wrapped version of it.

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::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 B.

Note that this function consumes the receiving future and returns a wrapped version of it.

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 

Map this service's output to a different type, returning a new service of the resulting type.

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone

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, 

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

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 

Map config to a different error, returning a new service.

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized

Replace config with unit

Loading content...

Implementations on Foreign Types

impl<S> NewService for Rc<S> where
    S: NewService
[src]

type Request = S::Request

type Response = S::Response

type Error = S::Error

type Config = S::Config

type Service = S::Service

type InitError = S::InitError

type Future = S::Future

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<S> NewService for Arc<S> where
    S: NewService
[src]

type Request = S::Request

type Response = S::Response

type Error = S::Error

type Config = S::Config

type Service = S::Service

type InitError = S::InitError

type Future = S::Future

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

Loading content...

Implementors

impl<A, B> NewService for AndThenNewService<A, B> where
    A: NewService,
    B: NewService<Config = A::Config, Request = A::Response, Error = A::Error, InitError = A::InitError>, 
[src]

type Request = A::Request

type Response = B::Response

type Error = A::Error

type Config = A::Config

type Service = AndThen<A::Service, B::Service>

type InitError = A::InitError

type Future = AndThenNewServiceFuture<A, B>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, B> NewService for ThenNewService<A, B> where
    A: NewService,
    B: NewService<Config = A::Config, Request = Result<A::Response, A::Error>, Error = A::Error, InitError = A::InitError>, 
[src]

type Request = A::Request

type Response = B::Response

type Error = A::Error

type Config = A::Config

type Service = Then<A::Service, B::Service>

type InitError = A::InitError

type Future = ThenNewServiceFuture<A, B>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, C> NewService for UnitConfig<A, C> where
    A: NewService<Config = ()>, 
[src]

type Request = A::Request

type Response = A::Response

type Error = A::Error

type Config = C

type Service = A::Service

type InitError = A::InitError

type Future = A::Future

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, E> NewService for FromErrNewService<A, E> where
    A: NewService,
    E: From<A::Error>, 
[src]

type Request = A::Request

type Response = A::Response

type Error = E

type Config = A::Config

type Service = FromErr<A::Service, E>

type InitError = A::InitError

type Future = FromErrNewServiceFuture<A, E>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, F, C> NewService for MapConfig<A, F, C> where
    A: NewService,
    F: Fn(&C) -> MappedConfig<A::Config>, 
[src]

type Request = A::Request

type Response = A::Response

type Error = A::Error

type Config = C

type Service = A::Service

type InitError = A::InitError

type Future = A::Future

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, F, E> NewService for MapErrNewService<A, F, E> where
    A: NewService,
    F: Fn(A::Error) -> E + Clone
[src]

type Request = A::Request

type Response = A::Response

type Error = E

type Config = A::Config

type Service = MapErr<A::Service, F, E>

type InitError = A::InitError

type Future = MapErrNewServiceFuture<A, F, E>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, F, E> NewService for MapInitErr<A, F, E> where
    A: NewService,
    F: Fn(A::InitError) -> E + Clone
[src]

type Request = A::Request

type Response = A::Response

type Error = A::Error

type Config = A::Config

type Service = A::Service

type InitError = E

type Future = MapInitErrFuture<A, F, E>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<A, F, Res> NewService for MapNewService<A, F, Res> where
    A: NewService,
    F: FnMut(A::Response) -> Res + Clone
[src]

type Request = A::Request

type Response = Res

type Error = A::Error

type Config = A::Config

type Service = Map<A::Service, F, Res>

type InitError = A::InitError

type Future = MapNewServiceFuture<A, F, Res>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<C, Req, Res, Err, InitErr> NewService for BoxedNewService<C, Req, Res, Err, InitErr> where
    Req: 'static,
    Res: 'static,
    Err: 'static,
    InitErr: 'static, 
[src]

type Request = Req

type Response = Res

type Error = Err

type InitError = InitErr

type Config = C

type Service = BoxedService<Req, Res, Err>

type Future = Box<dyn Future<Item = Self::Service, Error = Self::InitError>>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<R, E1, E2> NewService for BlankNewService<R, E1, E2>[src]

type Request = R

type Response = R

type Error = E1

type Config = ()

type Service = Blank<R, E1>

type InitError = E2

type Future = FutureResult<Self::Service, Self::InitError>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

impl<T, F, In, Out> NewService for ApplyNewService<T, F, In, Out> where
    T: NewService,
    F: FnMut(In, &mut T::Service) -> Out + Clone,
    Out: IntoFuture,
    Out::Error: From<T::Error>, 
[src]

type Request = In

type Response = Out::Item

type Error = Out::Error

type Config = T::Config

type Service = Apply<T::Service, F, In, Out>

type InitError = T::InitError

type Future = ApplyNewServiceFuture<T, F, In, Out>

fn apply<T, T1, B, B1>(
    self,
    transform: T1,
    service: B1
) -> AndThenTransform<T, Self, B> where
    Self: Sized,
    T: Transform<B::Service, Request = Self::Response, InitError = Self::InitError>,
    T::Error: From<Self::Error>,
    T1: IntoTransform<T, B::Service>,
    B: NewService<Config = Self::Config, InitError = Self::InitError>,
    B1: IntoNewService<B>, 
[src]

fn apply_fn<B, I, F, Out>(
    self,
    service: I,
    f: F
) -> AndThenApplyNewService<Self, B, F, Out> where
    Self: Sized,
    B: NewService<Config = Self::Config, Error = Self::Error, InitError = Self::InitError>,
    I: IntoNewService<B>,
    F: FnMut(Self::Response, &mut B::Service) -> Out,
    Out: IntoFuture,
    Out::Error: Into<Self::Error>, 
[src]

fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Self::Response, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn from_err<E>(self) -> FromErrNewService<Self, E> where
    Self: Sized,
    E: From<Self::Error>, 
[src]

fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B> where
    Self: Sized,
    F: IntoNewService<B>,
    B: NewService<Config = Self::Config, Request = Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>, 
[src]

fn map<F, R>(self, f: F) -> MapNewService<Self, F, R> where
    Self: Sized,
    F: FnMut(Self::Response) -> R, 
[src]

fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E> where
    Self: Sized,
    F: Fn(Self::Error) -> E + Clone
[src]

fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
    Self: Sized,
    F: Fn(Self::InitError) -> E, 
[src]

fn map_config<F, C>(self, f: F) -> MapConfig<Self, F, C> where
    Self: Sized,
    F: Fn(&C) -> MappedConfig<Self::Config>, 
[src]

fn unit_config<C>(self) -> UnitConfig<Self, C> where
    Self: NewService<Config = ()> + Sized
[src]

Loading content...