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<M> Connection for PooledConnection<M>where
M: ManageConnection,
M::Connection: Connection + R2D2Connection + Send + 'static,
impl<M> Connection for PooledConnection<M>where
M: ManageConnection,
M::Connection: Connection + R2D2Connection + Send + 'static,
type Backend = <<M as ManageConnection>::Connection as Connection>::Backend
type Backend = <<M as ManageConnection>::Connection as Connection>::Backend
The backend this type connects to
sourcefn establish(_: &str) -> ConnectionResult<Self>
fn establish(_: &str) -> ConnectionResult<Self>
Establishes a new connection to the database Read more
sourcefn 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 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.
sourcefn deref(&self) -> &<M as ManageConnection>::Connection
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,
sourcefn deref_mut(&mut self) -> &mut <M as ManageConnection>::Connection
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<M> MigrationConnection for PooledConnection<M>where
M: ManageConnection,
M::Connection: MigrationConnection,
Self: Connection,
impl<M> MigrationConnection for PooledConnection<M>where
M: ManageConnection,
M::Connection: MigrationConnection,
Self: Connection,
sourcefn setup(&mut self) -> QueryResult<usize>
fn setup(&mut self) -> QueryResult<usize>
Setup the following table: Read more
sourceimpl<M> SimpleConnection for PooledConnection<M>where
M: ManageConnection,
M::Connection: R2D2Connection + Send + 'static,
impl<M> SimpleConnection for PooledConnection<M>where
M: ManageConnection,
M::Connection: R2D2Connection + Send + 'static,
sourcefn 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
sourceimpl<Changes, Output, M> UpdateAndFetchResults<Changes, Output> for PooledConnection<M>where
M: ManageConnection,
M::Connection: UpdateAndFetchResults<Changes, Output>,
Self: Connection,
impl<Changes, Output, M> UpdateAndFetchResults<Changes, Output> for PooledConnection<M>where
M: ManageConnection,
M::Connection: UpdateAndFetchResults<Changes, Output>,
Self: Connection,
sourcefn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>
fn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>
See the traits documentation.
impl<B, M> LoadConnection<B> for PooledConnection<M>where
M: ManageConnection,
M::Connection: LoadConnection<B> + R2D2Connection,
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<C> BoxableConnection<<C as Connection>::Backend> for Cwhere
C: Connection + Any,
impl<C> BoxableConnection<<C as Connection>::Backend> for Cwhere
C: Connection + Any,
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> AsExprOf<Self, T>where
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> AsExprOf<Self, T>where
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresourcefn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more