RequestHandlerService

Trait RequestHandlerService 

Source
pub trait RequestHandlerService<State, PathParameters = ()> {
    // Required method
    async fn call_request_handler_service<R: Read, W: ResponseWriter<Error = R::Error>>(
        &self,
        state: &State,
        path_parameters: PathParameters,
        request: Request<'_, R>,
        response_writer: W,
    ) -> Result<ResponseSent, W::Error>;
}
Expand description

A service which handles Requests and writes the response to the provided ResponseWriter.

Required Methods§

Source

async fn call_request_handler_service<R: Read, W: ResponseWriter<Error = R::Error>>( &self, state: &State, path_parameters: PathParameters, request: Request<'_, R>, response_writer: W, ) -> Result<ResponseSent, W::Error>

Handle the request and write the response to the provided ResponseWriter.

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§

Source§

impl<State, PathParameters> RequestHandlerService<State, PathParameters> for File