pub struct ConnectionPool { /* private fields */ }Expand description
Holds the connection pool state for managing database or external connections
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(max_connections: usize) -> Self
pub fn new(max_connections: usize) -> Self
Creates a new connection pool with the specified maximum connections
Sourcepub fn acquire(&self) -> Result<ConnectionGuard, Error>
pub fn acquire(&self) -> Result<ConnectionGuard, Error>
Attempts to acquire a connection from the pool
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Returns the current number of active connections
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl UnsafeUnpin for ConnectionPool
impl UnwindSafe 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