pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for reusing Quinn connections
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(config: ConnectionPoolConfig) -> Self
pub fn new(config: ConnectionPoolConfig) -> Self
Create a new connection pool
Sourcepub async fn start(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn start(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
Start the connection pool with cleanup task
Sourcepub async fn get_connection(
&self,
peer_id: PeerId,
remote_address: SocketAddr,
endpoint: &QuinnEndpoint,
) -> Result<Arc<QuinnConnection>, Box<dyn Error + Send + Sync>>
pub async fn get_connection( &self, peer_id: PeerId, remote_address: SocketAddr, endpoint: &QuinnEndpoint, ) -> Result<Arc<QuinnConnection>, Box<dyn Error + Send + Sync>>
Get or create a connection for a peer
Sourcepub async fn get_stats(&self) -> ConnectionPoolStats
pub async fn get_stats(&self) -> ConnectionPoolStats
Get connection pool statistics
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 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