pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool wrapper using deadpool-postgres
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
pub async fn new(connection_string: &str, config: PoolConfig) -> Result<Self>
Sourcepub async fn acquire(&self) -> MCPResult<Arc<Object>>
pub async fn acquire(&self) -> MCPResult<Arc<Object>>
Acquire a connection from the pool Returns Arc
Sourcepub fn release(&self, _conn: Arc<Object>)
pub fn release(&self, _conn: Arc<Object>)
Release a connection back to the pool (handled automatically by deadpool)
pub fn active_count(&self) -> u32
pub fn max_size(&self) -> u32
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionPool
impl !UnwindSafe for ConnectionPool
impl Freeze for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl UnsafeUnpin for ConnectionPool
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