pub struct PoolConnection { /* private fields */ }Expand description
A connection borrowed from the pool.
Uses std::sync::Mutex for interior mutability because the driver’s
PoolGuard requires &mut self for queries, but the Executor trait
takes &self. The mutex is uncontended in practice — a single connection
is used by one caller at a time, never shared between concurrent callers.
Returned to the pool when dropped.
Trait Implementations§
Source§impl Debug for PoolConnection
impl Debug for PoolConnection
Source§impl Executor for PoolConnection
impl Executor for PoolConnection
Source§fn query_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>
fn query_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<OwnedResult>
Execute a query and return all rows.
Source§fn query_raw_readonly(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>
fn query_raw_readonly( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<OwnedResult>
Execute a read-only query. May route to replicas in the future.
Source§fn execute_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<u64>
fn execute_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<u64>
Execute a query and return the number of affected rows.
Auto Trait Implementations§
impl !Freeze for PoolConnection
impl RefUnwindSafe for PoolConnection
impl Send for PoolConnection
impl Sync for PoolConnection
impl Unpin for PoolConnection
impl UnsafeUnpin for PoolConnection
impl UnwindSafe for PoolConnection
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