[−][src]Struct diesel::r2d2::Extensions
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.
Methods
impl Extensions
[src]
pub fn new() -> Extensions
[src]
Returns a new, empty Extensions
.
pub fn insert<T>(&mut self, value: T) -> Option<T> where
T: 'static + Sync + Send,
[src]
T: 'static + Sync + Send,
Inserts a new value into the map.
Returns the previously stored value of that type, if present.
pub fn get<T>(&self) -> Option<&T> where
T: 'static + Sync + Send,
[src]
T: 'static + Sync + Send,
Returns a shared reference to the stored value of the specified type.
pub fn get_mut<T>(&mut self) -> Option<&mut T> where
T: 'static + Sync + Send,
[src]
T: 'static + Sync + Send,
Returns a mutable reference to the stored value of the specified type.
pub fn remove<T>(&mut self) -> Option<T> where
T: 'static + Sync + Send,
[src]
T: 'static + Sync + Send,
Removes the value of the specified type from the map, returning it.
pub fn clear(&mut self)
[src]
Removes all values from the map.
Trait Implementations
impl Default for Extensions
[src]
fn default() -> Extensions
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl !UnwindSafe for Extensions
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
Self: AsExpression<T> + Sized,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,