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.

Check if container contains value for type

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.

Clear the Extensions of all inserted values.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.