pub fn from_fn<'a, F, Fut, Input, Output, Descr>(
f: F
) -> Handler<'a, Input, Output, Descr> where
F: Fn(Input, Cont<'a, Input, Output>) -> Fut,
F: Send + Sync + 'a,
Fut: Future<Output = ControlFlow<Output, Input>> + Send + 'a,
Descr: HandlerDescription,
Expand description
Constructs a handler from a function.
Most of the time, you do not want to use this function. Take a look at more
specialised functions: crate::endpoint
, crate::filter
,
crate::filter_map
, etc.