pub fn with_state<S, F, Fut>(state: S, f: F) -> MiddlewareExpand description
Middleware with owned state — hides the Arc::clone dance.
Prefer this over capturing many fields and cloning them into each future.
If a closure needs more than one .clone(), the state should be one Arc
(this helper) or process-lifetime &'static via with_leaked.