lazy

Function lazy 

Source
pub fn lazy<F, T>(f: F) -> Lazy<F>
where F: Fn(&mut Context<'_>) -> Option<T> + Send + Sync, T: Send,
Expand description

Create an endpoint which applies the given function to the incoming request and returns an immediate value of T.

NOTE: The trait bound of returned value from F should be replaced with IntoTask.