pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for backend servers
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
pub fn new(max_connections: usize) -> Self
Sourcepub async fn get_connection(
&self,
server: &ServerConfig,
_proxy: &NntpProxy,
) -> Result<PooledConnection>
pub async fn get_connection( &self, server: &ServerConfig, _proxy: &NntpProxy, ) -> Result<PooledConnection>
Get a connection from the pool or create a new one
Sourcepub async fn return_connection(&self, conn: PooledConnection)
pub async fn return_connection(&self, conn: PooledConnection)
Return a connection to the pool
Trait Implementations§
Source§impl Clone for ConnectionPool
impl Clone for ConnectionPool
Source§fn clone(&self) -> ConnectionPool
fn clone(&self) -> ConnectionPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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