pub fn from_fn<F, Fut>(f: F) -> FromFnLayer<F>where F: Fn(Request, Next) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Response> + Send + 'static,
Build a middleware layer from an async function (Request, Next) -> Response.
(Request, Next) -> Response