pub trait Service<Request> {
    type Response;
    type Error;

    // Required method
    fn call(
        &self,
        req: Request
    ) -> impl Future<Output = Result<Self::Response, Self::Error>>;
}

Required Associated Types§

source

type Response

Responses given by the service.

source

type Error

Errors produced by the service.

Required Methods§

source

fn call( &self, req: Request ) -> impl Future<Output = Result<Self::Response, Self::Error>>

Process the request and return the response asynchronously.

Object Safety§

This trait is not object safe.

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

source§

impl<Request, Response, E> Service<Request> for BoxedService<Request, Response, E>

§

type Response = Response

§

type Error = E

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