pub trait Handler:
Send
+ Sync
+ 'static {
// Required method
fn call(&self, ctx: Context) -> BoxFuture<Response>;
}Expand description
Something that turns a request into a response.
Implemented for any async fn(Context) -> impl IntoResponse, so plain
functions and closures can be used as route handlers.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".