[][src]Module gotham::state

Defines types for passing request state through Middleware and Handler implementations

Re-exports

pub use state::request_id::request_id;

Modules

request_id

Defines a unique id per Request that should be output with all logging.

Structs

State

Provides storage for request state, and stores one item of each type. The types used for storage must implement the gotham::state::StateData trait to allow its storage. The gotham_derive crate provides a custom derive for StateData to make this more convenient.

Traits

FromState

A trait for accessing data that is stored in State.

StateData

A marker trait for types that can be stored in State.

Functions

client_addr

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.