Struct diesel::r2d2::PooledConnection
source · [−]pub struct PooledConnection<M> where
M: ManageConnection, { /* private fields */ }
Expand description
A smart pointer wrapping a connection.
Implementations
sourceimpl<M> PooledConnection<M> where
M: ManageConnection,
impl<M> PooledConnection<M> where
M: ManageConnection,
sourcepub fn extensions(this: &PooledConnection<M>) -> &Extensions
pub fn extensions(this: &PooledConnection<M>) -> &Extensions
Returns a shared reference to the extensions associated with this connection.
sourcepub fn extensions_mut(this: &mut PooledConnection<M>) -> &mut Extensions
pub fn extensions_mut(this: &mut PooledConnection<M>) -> &mut Extensions
Returns a mutable reference to the extensions associated with this connection.
Trait Implementations
sourceimpl<C> Connection for PooledConnection<ConnectionManager<C>> where
C: Connection<TransactionManager = AnsiTransactionManager> + Send + 'static,
C::Backend: UsesAnsiSavepointSyntax,
impl<C> Connection for PooledConnection<ConnectionManager<C>> where
C: Connection<TransactionManager = AnsiTransactionManager> + Send + 'static,
C::Backend: UsesAnsiSavepointSyntax,
sourcefn establish(_: &str) -> ConnectionResult<Self>
fn establish(_: &str) -> ConnectionResult<Self>
Establishes a new connection to the database Read more
sourcefn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
Executes the given function inside of a database transaction Read more
sourcefn begin_test_transaction(&self) -> QueryResult<()>
fn begin_test_transaction(&self) -> QueryResult<()>
Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more
sourceimpl<M> Debug for PooledConnection<M> where
M: ManageConnection,
<M as ManageConnection>::Connection: Debug,
impl<M> Debug for PooledConnection<M> where
M: ManageConnection,
<M as ManageConnection>::Connection: Debug,
sourceimpl<M> Deref for PooledConnection<M> where
M: ManageConnection,
impl<M> Deref for PooledConnection<M> where
M: ManageConnection,
type Target = <M as ManageConnection>::Connection
type Target = <M as ManageConnection>::Connection
The resulting type after dereferencing.
sourcepub fn deref(&self) -> &<M as ManageConnection>::Connection
pub fn deref(&self) -> &<M as ManageConnection>::Connection
Dereferences the value.
sourceimpl<M> DerefMut for PooledConnection<M> where
M: ManageConnection,
impl<M> DerefMut for PooledConnection<M> where
M: ManageConnection,
sourcepub fn deref_mut(&mut self) -> &mut <M as ManageConnection>::Connection
pub fn deref_mut(&mut self) -> &mut <M as ManageConnection>::Connection
Mutably dereferences the value.
sourceimpl<M> Drop for PooledConnection<M> where
M: ManageConnection,
impl<M> Drop for PooledConnection<M> where
M: ManageConnection,
sourceimpl<T> SimpleConnection for PooledConnection<ConnectionManager<T>> where
T: Connection + Send + 'static,
impl<T> SimpleConnection for PooledConnection<ConnectionManager<T>> where
T: Connection + Send + 'static,
sourcefn batch_execute(&self, query: &str) -> QueryResult<()>
fn batch_execute(&self, query: &str) -> QueryResult<()>
Execute multiple SQL statements within the same string. Read more
Auto Trait Implementations
impl<M> !RefUnwindSafe for PooledConnection<M>
impl<M> Send for PooledConnection<M>
impl<M> Sync for PooledConnection<M> where
<M as ManageConnection>::Connection: Sync,
impl<M> Unpin for PooledConnection<M> where
<M as ManageConnection>::Connection: Unpin,
impl<M> !UnwindSafe for PooledConnection<M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more