pub fn from_fn<'a, F, Fut, Output, Descr>(
f: F,
sig: HandlerSignature,
) -> Handler<'a, Output, Descr>where
F: Fn(DependencyMap, Cont<'a, Output>) -> Fut + Send + Sync + 'a,
Fut: Future<Output = ControlFlow<Output, DependencyMap>> + Send + 'a,
Descr: HandlerDescription,Expand description
Constructs a handler from a function.
sig is the run-time handler signature used for type inference and
checking.
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.