Skip to main content

HyperClientAdaptor

Trait HyperClientAdaptor 

Source
pub trait HyperClientAdaptor<M>
where M: 'static + Send + Sync + Sized + Clone + Debug + Tvf + Default,
{ // Required methods fn new( proc: &HyperClientProc<M>, ) -> Result<Self, Box<dyn ProcError + Send + Sync>> where Self: Sized; fn process_srv_request( &self, request: M, socket_url: &Url, ) -> Result<Request<BoxBody<Bytes, Infallible>>, ServiceError>; fn process_http_response( &self, resp: Result<Response<Incoming>, Error>, ) -> impl Future<Output = Result<M, ServiceError>> + Send; }
Expand description

Trait to define the Hyper adaptor structure

graph LR OUT1[Output HTTP server] ProSA[ProSA Hyper Procesor] ProSA-- HTTP request (process_client_request) -->OUT OUT-- HTTP response (process_client_response) -->ProSA

Required Methods§

Source

fn new( proc: &HyperClientProc<M>, ) -> Result<Self, Box<dyn ProcError + Send + Sync>>
where Self: Sized,

Create a new adaptor

Source

fn process_srv_request( &self, request: M, socket_url: &Url, ) -> Result<Request<BoxBody<Bytes, Infallible>>, ServiceError>

Method to process input HTTP requests. Received by the ProSA through Hyper

Source

fn process_http_response( &self, resp: Result<Response<Incoming>, Error>, ) -> impl Future<Output = Result<M, ServiceError>> + Send

Method to process input HTTP response to respond with an TVF response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§