Function from_fn_with_state
fn from_fn_with_state<F, S, T>(state: S, f: F) -> FromFnLayer<F, S, T>
Create a middleware from an async function with the given state.
For the requirements for the function supplied see from_fn.
See State for more details about accessing state.
Example
use ;
async
let state = AppState ;
let app = new
.route
.route_layer
.with_state;
# let _: Router = app;