pub struct PgPoolBuilder { /* private fields */ }Expand description
Builder for creating a connection pool.
Debug output redacts passwords (in the config and in the URL).
Implementations§
Source§impl PgPoolBuilder
impl PgPoolBuilder
Sourcepub fn max_connections(self, n: usize) -> Self
pub fn max_connections(self, n: usize) -> Self
Set the maximum number of connections.
Sourcepub fn min_connections(self, n: usize) -> Self
pub fn min_connections(self, n: usize) -> Self
Set the minimum number of connections.
Sourcepub fn connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
Set the connection timeout.
Sourcepub fn idle_timeout(self, timeout: impl Into<Option<Duration>>) -> Self
pub fn idle_timeout(self, timeout: impl Into<Option<Duration>>) -> Self
Set the idle timeout enforced at checkout (see
PoolConfig::idle_timeout). Pass None to disable.
Sourcepub fn recycle_timeout(self, timeout: impl Into<Option<Duration>>) -> Self
pub fn recycle_timeout(self, timeout: impl Into<Option<Duration>>) -> Self
Set the bound on the recycle check at checkout
(see PoolConfig::recycle_timeout). Pass None to disable.
Sourcepub fn max_lifetime(self, lifetime: impl Into<Option<Duration>>) -> Self
pub fn max_lifetime(self, lifetime: impl Into<Option<Duration>>) -> Self
Set the maximum connection lifetime. Pass None to disable.
Sourcepub fn recycling(self, recycling: PgRecycling) -> Self
pub fn recycling(self, recycling: PgRecycling) -> Self
Set the recycling method used when a connection is checked out again.
Sourcepub fn statement_cache_size(self, size: usize) -> Self
pub fn statement_cache_size(self, size: usize) -> Self
Set the prepared statement cache size.
Trait Implementations§
Source§impl Debug for PgPoolBuilder
impl Debug for PgPoolBuilder
Auto Trait Implementations§
impl Forget for PgPoolBuilder
impl Freeze for PgPoolBuilder
impl Move for PgPoolBuilder
impl RefUnwindSafe for PgPoolBuilder
impl Send for PgPoolBuilder
impl Sync for PgPoolBuilder
impl Unpin for PgPoolBuilder
impl UnsafeUnpin for PgPoolBuilder
impl UnwindSafe for PgPoolBuilder
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