Skip to main content

handler_fn

Function handler_fn 

Source
pub fn handler_fn<F, Fut>(func: F) -> HandlerFunc
where F: Fn(Context) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,
Expand description

Creates a handler function from an async function.

§Arguments

  • Fn(Context) -> Fut + Send + Sync + 'static - The async function to wrap.
  • Future<Output = ()> + Send + 'static - The future type returned by the function.

§Returns

  • HandlerFunc - A boxed handler function.