pub struct ConnectionPool { /* private fields */ }Expand description
ConnectionPool which provide pooling capability for Connection objects It has support for max number of connections with temporary allowable connections
Implementations§
Source§impl ConnectionPool
Connection pool implementation
impl ConnectionPool
Connection pool implementation
Sourcepub fn new(
pool_min_size: usize,
pool_max_size: usize,
tmp_allowed: bool,
conn_config: &Config,
) -> ConnectionPool
pub fn new( pool_min_size: usize, pool_max_size: usize, tmp_allowed: bool, conn_config: &Config, ) -> ConnectionPool
New instance
Sourcepub fn release_all(&self)
pub fn release_all(&self)
Release all : Remove all connections from th pool
Sourcepub fn release(&self, conn: Connection)
pub fn release(&self, conn: Connection)
Releae connection
Sourcepub fn drop(&self, conn: Connection)
pub fn drop(&self, conn: Connection)
Drop connection. Use only if disconect.
Sourcepub fn acquire(&self) -> Result<Connection>
pub fn acquire(&self) -> Result<Connection>
Aquire Connection
Trait Implementations§
Source§impl Default for ConnectionPool
Default implementation for ConnectionPool
impl Default for ConnectionPool
Default implementation for ConnectionPool
Source§fn default() -> ConnectionPool
fn default() -> ConnectionPool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ConnectionPool
impl RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin 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