pub struct Pool { /* private fields */ }Expand description
Blocking pool sharing the native semaphore and cancellation-safe lease cleanup.
Implementations§
Source§impl Pool
impl Pool
pub fn connect(config: PoolConfig) -> NzResult<Self>
pub fn get(&self) -> NzResult<PooledConnection>
pub fn query(&self, sql: &str, params: &[&dyn ToSql]) -> NzResult<Vec<Row>>
pub fn query_multi( &self, sql: &str, params: &[&dyn ToSql], ) -> NzResult<QueryResult>
pub fn execute(&self, sql: &str, params: &[&dyn ToSql]) -> NzResult<i64>
pub fn close(&self)
pub fn total_count(&self) -> usize
pub fn idle_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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