pub struct PoolRef<'a, M: Manager> { /* private fields */ }
Implementations§
Source§impl<M: Manager> PoolRef<'_, M>
impl<M: Manager> PoolRef<'_, M>
Sourcepub fn get_conn(&mut self) -> &mut M::Connection
pub fn get_conn(&mut self) -> &mut M::Connection
get a mut reference of connection.
Sourcepub fn take_conn(&mut self) -> Option<M::Connection>
pub fn take_conn(&mut self) -> Option<M::Connection>
take the the ownership of connection from pool and it won’t be pushed back to pool anymore.
Sourcepub fn push_conn(&mut self, conn: M::Connection)
pub fn push_conn(&mut self, conn: M::Connection)
manually push a connection to pool. We treat this connection as a new born one.
operation will fail if the pool is already in full capacity(no error will return and this connection will be dropped silently)
pub fn get_manager(&self) -> &M
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> Freeze for PoolRef<'a, M>
impl<'a, M> !RefUnwindSafe for PoolRef<'a, M>
impl<'a, M> Send for PoolRef<'a, M>
impl<'a, M> Sync for PoolRef<'a, M>
impl<'a, M> Unpin for PoolRef<'a, M>
impl<'a, M> !UnwindSafe for PoolRef<'a, 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