pub trait Handler {
type Error: Display;
// Required method
fn handle<'async_trait>(
self,
req: Request<IncomingBody>,
) -> Pin<Box<dyn Future<Output = Result<Response<Full<Bytes>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
A handler that can be used by a Server. If the handler returns an error, the error will be logged and a 500 response will be returned to the client.
Required Associated Types§
Required Methods§
fn handle<'async_trait>(
self,
req: Request<IncomingBody>,
) -> Pin<Box<dyn Future<Output = Result<Response<Full<Bytes>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".