pub trait Handler:
Send
+ Sync
+ 'static {
// Required method
fn call(&self, request: Request) -> BoxFuture<Response>;
}Expand description
Anything that can answer a request.
Implemented for every async fn(Request) -> impl IntoResponse, so an
application never names this trait: it just writes a function.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".