Struct rusqlite_pool::ConnectionHandle
source · pub struct ConnectionHandle { /* private fields */ }Expand description
A temporary handle to a rusqlite::Connection provided by a
ConnectionPool.
Upon ConnectionHandle::access or drop, the inner Connection is
placed back in the pool’s inner idle queue for future use.
As a result, in async or multi-threaded environments, care should be taken
to avoid holding onto a ConnectionHandle any longer than necessary to
avoid blocking access to connections elsewhere.
Implementations§
source§impl ConnectionHandle
impl ConnectionHandle
sourcepub fn access<O>(self, f: impl FnOnce(&mut Connection) -> O) -> O
pub fn access<O>(self, f: impl FnOnce(&mut Connection) -> O) -> O
Consume the ConnectionHandle and provide access to the inner
rusqlite::Connection via the given function.
After the given function is called, the connection is immediately placed
back on the Pools idle queue and the handle is dropped.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ConnectionHandle
impl !RefUnwindSafe for ConnectionHandle
impl Send for ConnectionHandle
impl !Sync for ConnectionHandle
impl Unpin for ConnectionHandle
impl !UnwindSafe for ConnectionHandle
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