Skip to main content

from_fn

Function from_fn 

Source
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,
Expand description

Build a middleware layer from an async function (Request, Next) -> Response.