pub fn middleware_fn<F, R, Q>(
    middleware: F
) -> impl Layer<RequestHandler, Service = RequestHandler> where
    R: Fn(Request<Body>) -> Q,
    Q: Future<Output = ResponseResult> + Send + 'static,
    F: Fn(Handler) -> R + Send + Sync + 'static, 
Expand description

middleware_fn creates middleware implementations from function pointers or closures