pub struct PoolConfigBuilder { /* private fields */ }Expand description
Builder for pool configuration.
Implementations§
Source§impl PoolConfigBuilder
impl PoolConfigBuilder
Sourcepub fn strategy(self, strategy: PoolStrategy) -> Self
pub fn strategy(self, strategy: PoolStrategy) -> Self
Set the pool strategy.
Use shared pool strategy.
Sourcepub fn per_tenant(self, max_pools: usize, pool_size: usize) -> Self
pub fn per_tenant(self, max_pools: usize, pool_size: usize) -> Self
Use per-tenant pool strategy.
Sourcepub fn per_database(self, max_databases: usize, pool_size: usize) -> Self
pub fn per_database(self, max_databases: usize, pool_size: usize) -> Self
Use per-database pool strategy.
Sourcepub fn warmup_size(self, size: usize) -> Self
pub fn warmup_size(self, size: usize) -> Self
Set warmup size.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set idle timeout.
Sourcepub fn max_lifetime(self, lifetime: Duration) -> Self
pub fn max_lifetime(self, lifetime: Duration) -> Self
Set max lifetime.
Sourcepub fn health_check(self, enabled: bool) -> Self
pub fn health_check(self, enabled: bool) -> Self
Enable/disable health checks.
Sourcepub fn health_check_interval(self, interval: Duration) -> Self
pub fn health_check_interval(self, interval: Duration) -> Self
Set health check interval.
Sourcepub fn build(self) -> PoolConfig
pub fn build(self) -> PoolConfig
Build the config.
Trait Implementations§
Source§impl Default for PoolConfigBuilder
impl Default for PoolConfigBuilder
Source§fn default() -> PoolConfigBuilder
fn default() -> PoolConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PoolConfigBuilder
impl RefUnwindSafe for PoolConfigBuilder
impl Send for PoolConfigBuilder
impl Sync for PoolConfigBuilder
impl Unpin for PoolConfigBuilder
impl UnwindSafe for PoolConfigBuilder
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