Skip to main content

Module context

Module context 

Source
Expand description

Typed per-request storage keyed by TypeId.

Middleware writes into the context (req.ctx_mut().insert(User { .. })); handlers and later middleware read by type (req.ctx().get::<User>()). Stored values only need to be Send + Sync + 'static — no Clone bound.

Structs§

Context