pub struct ConnectionPoolConfig {
pub max_connections: usize,
pub idle_timeout: Duration,
pub enable_keepalive: bool,
pub keepalive_interval: Duration,
}Expand description
Connection pool configuration.
Fields§
§max_connections: usizeMaximum number of connections in the pool.
idle_timeout: DurationIdle timeout - connections idle longer than this are removed.
enable_keepalive: boolWhether to enable keep-alive for pooled connections.
keepalive_interval: DurationKeep-alive interval (if enabled).
Implementations§
Source§impl ConnectionPoolConfig
impl ConnectionPoolConfig
Sourcepub fn with_max_connections(self, max: usize) -> Self
pub fn with_max_connections(self, max: usize) -> Self
Sets the maximum number of connections.
Sourcepub fn with_idle_timeout(self, timeout: Duration) -> Self
pub fn with_idle_timeout(self, timeout: Duration) -> Self
Sets the idle timeout.
Sourcepub fn with_keepalive(self, enabled: bool) -> Self
pub fn with_keepalive(self, enabled: bool) -> Self
Enables or disables keep-alive.
Sourcepub fn with_keepalive_interval(self, interval: Duration) -> Self
pub fn with_keepalive_interval(self, interval: Duration) -> Self
Sets the keep-alive interval.
Trait Implementations§
Source§impl Clone for ConnectionPoolConfig
impl Clone for ConnectionPoolConfig
Source§impl Debug for ConnectionPoolConfig
impl Debug for ConnectionPoolConfig
Auto Trait Implementations§
impl Freeze for ConnectionPoolConfig
impl RefUnwindSafe for ConnectionPoolConfig
impl Send for ConnectionPoolConfig
impl Sync for ConnectionPoolConfig
impl Unpin for ConnectionPoolConfig
impl UnsafeUnpin for ConnectionPoolConfig
impl UnwindSafe for ConnectionPoolConfig
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