pub trait HyperClientAdaptor<M>{
// 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§
Sourcefn new(
proc: &HyperClientProc<M>,
) -> Result<Self, Box<dyn ProcError + Send + Sync>>where
Self: Sized,
fn new(
proc: &HyperClientProc<M>,
) -> Result<Self, Box<dyn ProcError + Send + Sync>>where
Self: Sized,
Create a new adaptor
Sourcefn process_srv_request(
&self,
request: M,
socket_url: &Url,
) -> Result<Request<BoxBody<Bytes, Infallible>>, ServiceError>
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
Sourcefn process_http_response(
&self,
resp: Result<Response<Incoming>, Error>,
) -> impl Future<Output = Result<M, ServiceError>> + Send
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.