Struct diesel::r2d2::Extensions

source ·
pub struct Extensions(_);
Expand description

A “type map” used to associate data with pooled connections.

Extensions is a data structure mapping types to a value of that type. This can be used to, for example, cache prepared statements along side their connection.

Implementations§

Returns a new, empty Extensions.

Inserts a new value into the map.

Returns the previously stored value of that type, if present.

Returns a shared reference to the stored value of the specified type.

Returns a mutable reference to the stored value of the specified type.

Removes the value of the specified type from the map, returning it.

Removes all values from the map.

Trait Implementations§

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to an expression for Diesel’s query builder. Read more
Convert &self to an expression for Diesel’s query builder. Read more
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.