pub trait ExcService<R>
where R: Request,
{ type Future: Future<Output = Result<R::Response, ExchangeError>>; // Required methods fn poll_ready( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), ExchangeError>>; fn call(&mut self, req: R) -> Self::Future; // Provided method fn as_service(&mut self) -> AsService<'_, Self, R> where Self: Sized { ... } }
Expand description

An alias of [Service] that requires the input type to be a Request, and the error type to be ExchangeError.

Basically, Request is just indicating that the input type has a fixed response type.

Required Associated Types§

source

type Future: Future<Output = Result<R::Response, ExchangeError>>

The future response value.

Required Methods§

source

fn poll_ready( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), ExchangeError>>

See [Service::poll_ready] for more details.

source

fn call(&mut self, req: R) -> Self::Future

See [Service::call] for more details.

Provided Methods§

source

fn as_service(&mut self) -> AsService<'_, Self, R>
where Self: Sized,

Convert to a [Service].

Implementors§

source§

impl<S, R> ExcService<R> for S
where S: Service<R, Response = R::Response, Error = ExchangeError>, R: Request,

§

type Future = <S as Service<R>>::Future