pub trait IntoHandler<Marker> {
type Handler: Handler;
// Required method
fn into_handler(self) -> Self::Handler;
}Expand description
Bridge from a closure (or anything that is already a Handler) into a value
implementing Handler, so it can be passed to boxed and the router.
Two disjoint impls:
- extractor closures (
HandlerFn<Marker>) wrap into aHandlerFnAdapter; - anything already implementing
Handler(including aBoxHandler) passes through unchanged.
Required Associated Types§
Required Methods§
Sourcefn into_handler(self) -> Self::Handler
fn into_handler(self) -> Self::Handler
Convert self into its Handler representation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<Marker, H> IntoHandler<(IsHandler, Marker)> for H
Closures of any supported arity convert via the adapter. The wrapping marker
keeps this disjoint from the IsHandler pass-through (closures do not
implement Handler directly, so no closure can match both impls).
impl<Marker, H> IntoHandler<(IsHandler, Marker)> for H
Closures of any supported arity convert via the adapter. The wrapping marker
keeps this disjoint from the IsHandler pass-through (closures do not
implement Handler directly, so no closure can match both impls).