Struct trillium_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.
Gets a value from this typemap or populates it with the provided default function.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Extensionsimpl Send for Extensionsimpl Sync for Extensionsimpl Unpin for Extensionsimpl !UnwindSafe for Extensions