pub trait Service<Request> {
    type Response;
    type Error;
    type Future<'cx>: Future<Output = Result<Self::Response, Self::Error>>
       where Self: 'cx,
             Request: 'cx;

    // Required method
    fn call(&self, req: Request) -> Self::Future<'_>;
}

Required Associated Types§

source

type Response

Responses given by the service.

source

type Error

Errors produced by the service.

source

type Future<'cx>: Future<Output = Result<Self::Response, Self::Error>> where Self: 'cx, Request: 'cx

The future response value.

Required Methods§

source

fn call(&self, req: Request) -> Self::Future<'_>

Process the request and return the response asynchronously.

Implementors§

source§

impl<A, B, R> Service<R> for Either<A, B>where A: Service<R>, B: Service<R, Response = A::Response, Error = A::Error>,

§

type Response = <A as Service<R>>::Response

§

type Error = <A as Service<R>>::Error

§

type Future<'cx> = Either<<A as Service<R>>::Future<'cx>, <B as Service<R>>::Future<'cx>> where Self: 'cx, R: 'cx

source§

impl<T, F, R> Service<R> for MapTargetService<T, F>where F: MapTarget<R>, T: Service<F::Target>,

§

type Response = <T as Service<<F as MapTarget<R>>::Target>>::Response

§

type Error = <T as Service<<F as MapTarget<R>>::Target>>::Error

§

type Future<'cx> = impl Future<Output = Result<<MapTargetService<T, F> as Service<R>>::Response, <MapTargetService<T, F> as Service<R>>::Error>> + 'cx where Self: 'cx, R: 'cx