pub struct PoolConfig {
pub min_size: usize,
pub max_size: usize,
pub idle_timeout: Duration,
pub max_lifetime: Duration,
pub max_waiters: usize,
pub circuit_breaker_threshold: usize,
pub circuit_breaker_timeout: Duration,
}Expand description
Configuration for connection pooling
Fields§
§min_size: usizeMinimum connections to maintain (pre-warmed)
max_size: usizeMaximum idle connections kept in the pool. A connection released while the pool already holds this many is closed instead of being kept.
idle_timeout: DurationTime-to-live for idle connections before eviction
max_lifetime: DurationMaximum lifetime of a connection regardless of idle time, measured from when the connection was created (reuse does not reset it)
max_waiters: usizeMaximum concurrent waiters for connections (backpressure limit)
circuit_breaker_threshold: usizeCircuit breaker: consecutive failures before opening
circuit_breaker_timeout: DurationCircuit breaker: time to wait before trying again
Implementations§
Trait Implementations§
Source§impl Clone for PoolConfig
impl Clone for PoolConfig
Source§impl Debug for PoolConfig
impl Debug for PoolConfig
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
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