Skip to content

std::http::state

Status: experimental

Dependency injection is closure capture: build the router from closures that capture the pool, the cache, and the configuration, and each handler reads what it captured. A captured heap value is shared, so one map serves every request.

API details and source

The implementation source contains the complete declarations and implementation notes. The table below lists canonical Gossamer call signatures; every item name links directly to its implementation file.

Item Canonical signature or declaration Description
AppState type AppState TypeMap of T values shared across handlers.
State type State Newtype wrapper T for ergonomic handler arguments.