pub trait HyperServerAdaptor<M>{
// Required methods
fn new(
proc: &HyperServerProc<M>,
) -> Result<Self, Box<dyn ProcError + Send + Sync>>
where Self: Sized;
fn process_http_request(
&self,
req: Request<Incoming>,
) -> impl Future<Output = HyperResp<Self, M>> + Send
where Self: Sized + Send + Sync + 'static,
M: 'static + Send + Sync + Sized + Clone + Debug + Tvf + Default;
// Provided method
fn response_builder<T>(&self, status_code: T) -> Builder
where T: TryInto<StatusCode>,
<T as TryInto<StatusCode>>::Error: Into<Error> { ... }
}Expand description
Trait to define the Hyper server adaptor structure
graph LR
IN[Input HTTP server]
ProSA[ProSA Hyper Procesor]
IN-- HTTP request (process_server_request) -->ProSA
ProSA-- HTTP response (process_server_response) -->IN
Required Methods§
Provided Methods§
Sourcefn response_builder<T>(&self, status_code: T) -> Builder
fn response_builder<T>(&self, status_code: T) -> Builder
Initiate a response builder with specific status code and headers from adaptor. The response with its header generated will be used by the processor in case of error
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.