pub struct PoolConnection<C: Connection> { /* private fields */ }Expand description
A connection managed by a [Pool][crate::pool::Pool].
Will be returned to the pool on-drop.
Implementations§
Source§impl<C: Connection> PoolConnection<C>
impl<C: Connection> PoolConnection<C>
Sourcepub fn detach(self) -> C
pub fn detach(self) -> C
Detach this connection from the pool, allowing it to open a replacement.
Note that if your application uses a single shared pool, this
effectively lets the application exceed the max_connections setting.
If min_connections is nonzero, a task will be spawned to replace this connection.
If you want the pool to treat this connection as permanently checked-out,
use .leak() instead.
Trait Implementations§
Source§impl<C: Connection> AsMut<C> for PoolConnection<C>
impl<C: Connection> AsMut<C> for PoolConnection<C>
Source§impl<C: Connection> AsRef<C> for PoolConnection<C>
impl<C: Connection> AsRef<C> for PoolConnection<C>
Source§impl<C: Connection> Debug for PoolConnection<C>
impl<C: Connection> Debug for PoolConnection<C>
Source§impl<C: Connection> Deref for PoolConnection<C>
impl<C: Connection> Deref for PoolConnection<C>
Source§impl<C: Connection> DerefMut for PoolConnection<C>
impl<C: Connection> DerefMut for PoolConnection<C>
Source§impl<C: Connection> Drop for PoolConnection<C>
Returns the connection to the [Pool][crate::pool::Pool] it was checked-out from.
impl<C: Connection> Drop for PoolConnection<C>
Returns the connection to the [Pool][crate::pool::Pool] it was checked-out from.
Source§impl<'c, C: Connection> From<PoolConnection<C>> for MaybePoolConnection<'c, C>
impl<'c, C: Connection> From<PoolConnection<C>> for MaybePoolConnection<'c, C>
Source§fn from(v: PoolConnection<C>) -> Self
fn from(v: PoolConnection<C>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<C> Freeze for PoolConnection<C>where
C: Freeze,
impl<C> !RefUnwindSafe for PoolConnection<C>
impl<C> Send for PoolConnection<C>
impl<C> Sync for PoolConnection<C>where
C: Sync,
impl<C> Unpin for PoolConnection<C>where
C: Unpin,
impl<C> !UnwindSafe for PoolConnection<C>
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