pub trait Handler: Send + Sync {
// Required method
fn serve_http(&self, w: &mut dyn ResponseWriter, r: &Request);
}Expand description
The core handler interface. Port of Go’s http.Handler.
Required Methods§
fn serve_http(&self, w: &mut dyn ResponseWriter, r: &Request)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<H: Handler> Handler for Arc<H>
Any Arc<H> where H: Handler is itself a Handler. This lets you
wrap a mux or other handler in an Arc and pass it directly to middleware
functions like timeout_handler.
impl<H: Handler> Handler for Arc<H>
Any Arc<H> where H: Handler is itself a Handler. This lets you
wrap a mux or other handler in an Arc and pass it directly to middleware
functions like timeout_handler.