Expand description
Defines types for passing request state through Middleware
and Handler
implementations
Structs§
- State
- 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§
- From
State - A trait for accessing data that is stored in
State
. - State
Data - 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 returnNone
. - request_
id - Returns the request ID associated with the current request.