Trait exc_core::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§
Required Methods§
sourcefn poll_ready(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), ExchangeError>>
fn poll_ready( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), ExchangeError>>
See [Service::poll_ready
] for more details.
Provided Methods§
sourcefn as_service(&mut self) -> AsService<'_, Self, R>where
Self: Sized,
fn as_service(&mut self) -> AsService<'_, Self, R>where
Self: Sized,
Convert to a [Service
].