pub trait Handler: Send + Sync + DynClone {
// Required method
fn handle(
&self,
req: HttpRequest
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync>>;
}Required Methods§
sourcefn handle(
&self,
req: HttpRequest
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync>>
fn handle( &self, req: HttpRequest ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync>>
Handle a request. The handler is called for requests with a matching path and method.