#[non_exhaustive]pub struct ConnPoolConfig {
pub addr: String,
pub user: String,
pub password: String,
pub database: String,
pub min_idle: usize,
pub max_size: usize,
pub max_lifetime: Duration,
pub max_lifetime_jitter: Duration,
pub checkout_timeout: Duration,
pub maintenance_interval: Duration,
pub test_on_checkout: bool,
}Expand description
Connection pool configuration.
Construct via ConnPoolConfig::default and update only the fields you care
about. Marked #[non_exhaustive] so adding new tuning knobs in future minor
releases is not a breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.addr: StringAddress (host:port).
user: StringUser.
password: StringPassword.
database: StringDatabase.
min_idle: usizeMinimum idle connections to maintain.
max_size: usizeMaximum total connections.
max_lifetime: DurationMaximum lifetime per connection (with jitter applied).
max_lifetime_jitter: DurationJitter range for max_lifetime (± this value).
checkout_timeout: DurationTimeout waiting for a connection from the pool.
maintenance_interval: DurationHow often to run the maintenance task.
test_on_checkout: boolWhether to verify connections on checkout.
Trait Implementations§
Source§impl Clone for ConnPoolConfig
impl Clone for ConnPoolConfig
Source§fn clone(&self) -> ConnPoolConfig
fn clone(&self) -> ConnPoolConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnPoolConfig
impl Debug for ConnPoolConfig
Auto Trait Implementations§
impl Freeze for ConnPoolConfig
impl RefUnwindSafe for ConnPoolConfig
impl Send for ConnPoolConfig
impl Sync for ConnPoolConfig
impl Unpin for ConnPoolConfig
impl UnsafeUnpin for ConnPoolConfig
impl UnwindSafe for ConnPoolConfig
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