pub trait Handler<T, S>: 'static {
type Output;
type Future: Future<Output = Self::Output> + 'static;
// Required method
fn call(&self, req: &Request, state: &S) -> Result<Self::Future, Rejection>;
}Expand description
An async function whose arguments are all FromRequest extractors.
Implemented for Fn(T1, …, T16) -> impl Future. T is a tuple of
the extractor types and only exists to keep the implementations apart.
The futures do not have to be Send, so browser futures (e.g. fetch) work on wasm.
They are polled once per frame by the router and wake egui up when they make progress.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".