Closed Nouzan closed 12 months ago
We use the following AdaptService trait to extend the original Adaptor trait:
AdaptService
Adaptor
/// Service that can handle request [`R`] with its inner request [`Req`]. pub trait AdaptService<Req, R>: ExcService<Req> where Req: Request, R: Request, { /// Future returned by [`AdaptService::into_response`]. type AdaptedResponse: Future<Output = Result<R::Response, ExchangeError>>; /// Adapt the request. fn from_request(&mut self, req: R) -> Result<Req, ExchangeError>; /// Adapt the response future fn into_response(&mut self, res: Self::Future) -> Self::AdaptedResponse; }
With AdaptService, we can now be able to insert extra information from a concrete exchange service into the request.
We use the following
AdaptService
trait to extend the originalAdaptor
trait:With
AdaptService
, we can now be able to insert extra information from a concrete exchange service into the request.