pub struct PoolBuilder<DB: Database> { /* private fields */ }Expand description
Builder for configuring a Pool before connecting.
Created via Pool::builder().
Implementations§
Source§impl<DB: Database> PoolBuilder<DB>
impl<DB: Database> PoolBuilder<DB>
Sourcepub fn max_connections(self, max: u32) -> Self
pub fn max_connections(self, max: u32) -> Self
Set the maximum number of connections the pool should maintain.
Sourcepub fn min_connections(self, min: u32) -> Self
pub fn min_connections(self, min: u32) -> Self
Set the minimum number of connections the pool should maintain.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set the maximum time a connection can sit idle before being closed.
Sourcepub fn max_lifetime(self, lifetime: Duration) -> Self
pub fn max_lifetime(self, lifetime: Duration) -> Self
Set the maximum lifetime of individual connections.
Sourcepub fn acquire_timeout(self, timeout: Duration) -> Self
pub fn acquire_timeout(self, timeout: Duration) -> Self
Set the maximum time to wait when acquiring a connection from the pool.
Auto Trait Implementations§
impl<DB> !RefUnwindSafe for PoolBuilder<DB>
impl<DB> !UnwindSafe for PoolBuilder<DB>
impl<DB> Freeze for PoolBuilder<DB>
impl<DB> Send for PoolBuilder<DB>
impl<DB> Sync for PoolBuilder<DB>
impl<DB> Unpin for PoolBuilder<DB>
impl<DB> UnsafeUnpin for PoolBuilder<DB>
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
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