pub struct EnhancedPoolConfigBuilder { /* private fields */ }Expand description
增强连接池配置构建器。
Implementations§
Source§impl EnhancedPoolConfigBuilder
impl EnhancedPoolConfigBuilder
Sourcepub fn max_connections(self, n: u32) -> Self
pub fn max_connections(self, n: u32) -> Self
设置最大连接数。
Sourcepub fn acquire_timeout_secs(self, secs: u64) -> Self
pub fn acquire_timeout_secs(self, secs: u64) -> Self
设置获取连接超时时间(秒)。
Sourcepub fn acquire_timeout_millis(self, millis: u64) -> Self
pub fn acquire_timeout_millis(self, millis: u64) -> Self
设置获取连接超时时间(毫秒)。
Sourcepub fn idle_timeout_secs(self, secs: u64) -> Self
pub fn idle_timeout_secs(self, secs: u64) -> Self
设置空闲连接超时时间(秒)。
Sourcepub fn max_lifetime_secs(self, secs: u64) -> Self
pub fn max_lifetime_secs(self, secs: u64) -> Self
设置连接最大生存时间(秒)。
Sourcepub fn test_on_acquire(self) -> Self
pub fn test_on_acquire(self) -> Self
启用获取连接时的测试查询。
Sourcepub fn test_query(self, sql: &str) -> Self
pub fn test_query(self, sql: &str) -> Self
设置测试查询 SQL。
Sourcepub fn build(self) -> Result<EnhancedPoolConfig, String>
pub fn build(self) -> Result<EnhancedPoolConfig, String>
构建配置,执行校验。
Trait Implementations§
Source§impl Clone for EnhancedPoolConfigBuilder
impl Clone for EnhancedPoolConfigBuilder
Source§fn clone(&self) -> EnhancedPoolConfigBuilder
fn clone(&self) -> EnhancedPoolConfigBuilder
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 EnhancedPoolConfigBuilder
impl Debug for EnhancedPoolConfigBuilder
Source§impl Default for EnhancedPoolConfigBuilder
impl Default for EnhancedPoolConfigBuilder
Source§fn default() -> EnhancedPoolConfigBuilder
fn default() -> EnhancedPoolConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnhancedPoolConfigBuilder
impl RefUnwindSafe for EnhancedPoolConfigBuilder
impl Send for EnhancedPoolConfigBuilder
impl Sync for EnhancedPoolConfigBuilder
impl Unpin for EnhancedPoolConfigBuilder
impl UnsafeUnpin for EnhancedPoolConfigBuilder
impl UnwindSafe for EnhancedPoolConfigBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more