pub trait RequestHandler<T = ()> {
// Required method
fn handle(
&self,
request: Request,
) -> impl Future<Output = Result<Response>> + Send;
}Expand description
A function that takes a request and returns a response.
This is the main building block of a Cot app. You shouldn’t
usually need to implement this directly, as it is already
implemented for closures and functions that take a Request
and return a Result<Response>.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.