Struct diesel::r2d2::PooledConnection
source · pub struct PooledConnection<M>where
M: ManageConnection,{ /* private fields */ }
Available on crate feature
r2d2
only.Expand description
A smart pointer wrapping a connection.
Implementations§
source§impl<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§
source§impl<M> Connection for PooledConnection<M>
impl<M> Connection for PooledConnection<M>
§type Backend = <<M as ManageConnection>::Connection as Connection>::Backend
type Backend = <<M as ManageConnection>::Connection as Connection>::Backend
The backend this type connects to
§type TransactionManager = PoolTransactionManager<<<M as ManageConnection>::Connection as Connection>::TransactionManager>
type TransactionManager = PoolTransactionManager<<<M as ManageConnection>::Connection as Connection>::TransactionManager>
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.The transaction manager implementation used by this connection
source§fn establish(_: &str) -> ConnectionResult<Self>
fn establish(_: &str) -> ConnectionResult<Self>
Establishes a new connection to the database Read more
source§fn begin_test_transaction(&mut self) -> QueryResult<()>
fn begin_test_transaction(&mut self) -> QueryResult<()>
Creates a transaction that will never be committed. This is useful for
tests. Panics if called while inside of a transaction or
if called with a connection containing a broken transaction
source§fn execute_returning_count<T>(&mut self, source: &T) -> QueryResult<usize>
fn execute_returning_count<T>(&mut self, source: &T) -> QueryResult<usize>
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Execute a single SQL statements given by a query and return
number of affected rows
source§fn transaction_state(
&mut self
) -> &mut <Self::TransactionManager as TransactionManager<Self>>::TransactionStateData
fn transaction_state( &mut self ) -> &mut <Self::TransactionManager as TransactionManager<Self>>::TransactionStateData
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Get access to the current transaction state of this connection Read more
source§fn transaction<T, E, F>(&mut self, f: F) -> Result<T, E>
fn transaction<T, E, F>(&mut self, f: F) -> Result<T, E>
Executes the given function inside of a database transaction Read more
source§impl<M> Debug for PooledConnection<M>
impl<M> Debug for PooledConnection<M>
source§impl<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.
source§fn deref(&self) -> &<M as ManageConnection>::Connection
fn deref(&self) -> &<M as ManageConnection>::Connection
Dereferences the value.
source§impl<M> DerefMut for PooledConnection<M>where
M: ManageConnection,
impl<M> DerefMut for PooledConnection<M>where
M: ManageConnection,
source§fn deref_mut(&mut self) -> &mut <M as ManageConnection>::Connection
fn deref_mut(&mut self) -> &mut <M as ManageConnection>::Connection
Mutably dereferences the value.
source§impl<M> Drop for PooledConnection<M>where
M: ManageConnection,
impl<M> Drop for PooledConnection<M>where
M: ManageConnection,
source§impl<B, M> LoadConnection<B> for PooledConnection<M>
impl<B, M> LoadConnection<B> for PooledConnection<M>
§type Cursor<'conn, 'query> = <<M as ManageConnection>::Connection as LoadConnection<B>>::Cursor<'conn, 'query>
type Cursor<'conn, 'query> = <<M as ManageConnection>::Connection as LoadConnection<B>>::Cursor<'conn, 'query>
The cursor type returned by
LoadConnection::load
Read more§type Row<'conn, 'query> = <<M as ManageConnection>::Connection as LoadConnection<B>>::Row<'conn, 'query>
type Row<'conn, 'query> = <<M as ManageConnection>::Connection as LoadConnection<B>>::Row<'conn, 'query>
The row type used as
Iterator::Item
for the iterator implementation
of LoadConnection::Cursor
source§fn load<'conn, 'query, T>(
&'conn mut self,
source: T
) -> QueryResult<Self::Cursor<'conn, 'query>>where
T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
Self::Backend: QueryMetadata<T::SqlType>,
fn load<'conn, 'query, T>(
&'conn mut self,
source: T
) -> QueryResult<Self::Cursor<'conn, 'query>>where
T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
Self::Backend: QueryMetadata<T::SqlType>,
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Executes a given query and returns any requested values Read more
source§impl<M> MigrationConnection for PooledConnection<M>
impl<M> MigrationConnection for PooledConnection<M>
source§impl<M> SimpleConnection for PooledConnection<M>
impl<M> SimpleConnection for PooledConnection<M>
source§fn batch_execute(&mut self, query: &str) -> QueryResult<()>
fn batch_execute(&mut self, query: &str) -> QueryResult<()>
Execute multiple SQL statements within the same string. Read more
source§impl<Changes, Output, M> UpdateAndFetchResults<Changes, Output> for PooledConnection<M>
impl<Changes, Output, M> UpdateAndFetchResults<Changes, Output> for PooledConnection<M>
source§fn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>
fn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>
See the traits documentation.
impl<M> ConnectionSealed for PooledConnection<M>
Auto Trait Implementations§
impl<M> Freeze for PooledConnection<M>
impl<M> !RefUnwindSafe for PooledConnection<M>
impl<M> Send for PooledConnection<M>
impl<M> Sync for PooledConnection<M>
impl<M> Unpin for PooledConnection<M>
impl<M> !UnwindSafe for PooledConnection<M>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more