ExcService

Trait ExcService 

Source
pub trait ExcService<R>
where R: Request,
{ type Future: Future<Output = Result<<R as Request>::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 as Request>::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 as Request>::Response, Error = ExchangeError>, R: Request,

Source§

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