Struct http_types::Extensions [−][src]
pub struct Extensions { /* fields omitted */ }
Expand description
A type to store extra data inside Request
and Response
.
Store and retrieve values by
TypeId
. This allows
storing arbitrary data that implements Sync + Send + 'static
. This is
useful when for example implementing middleware that needs to send values.
Implementations
Insert a value into this Extensions
.
If a value of this type already exists, it will be returned.
Get a reference to a value previously inserted on this Extensions
.
Get a mutable reference to a value previously inserted on this Extensions
.
Remove a value from this Extensions
.
If a value of this type exists, it will be returned.
Trait Implementations
Returns the “default value” for a type. Read more