Module gotham::state

source ·
Expand description

Defines types for passing request state through Middleware and Handler implementations

Structs

  • Provides storage for request state, and stores one item of each type. The types used for storage must implement the StateData trait to allow its storage, which is usually done by adding #[derive(StateData)] on the type in question.

Traits

  • A trait for accessing data that is stored in State.
  • A marker trait for types that can be stored in State.

Functions

  • Returns the client SocketAddr as reported by hyper, if one was present. Certain connections do not report a client address, in which case this will return None.
  • Returns the request ID associated with the current request.

Derive Macros