nntp_proxy/pool/connection_trait.rs
1use async_trait::async_trait;
2
3/// Generic connection pool status information
4#[derive(Debug, Clone)]
5#[allow(dead_code)] // Used in greetings and monitoring
6pub struct PoolStatus {
7 pub available: usize,
8 pub max_size: usize,
9 pub created: usize,
10}
11
12/// Trait for connection management - makes it easy to swap implementations
13#[async_trait]
14pub trait ConnectionProvider: Send + Sync + Clone + std::fmt::Debug {
15 /// Get current pool status for monitoring
16 #[allow(dead_code)] // Used for client greetings
17 fn status(&self) -> PoolStatus;
18}