pub struct PgPoolBuilder { /* private fields */ }Expand description
Builder for creating a connection pool.
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: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set the idle timeout.
Sourcepub fn max_lifetime(self, lifetime: Duration) -> Self
pub fn max_lifetime(self, lifetime: Duration) -> Self
Set the maximum connection lifetime.
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
Source§impl Default for PgPoolBuilder
impl Default for PgPoolBuilder
Source§fn default() -> PgPoolBuilder
fn default() -> PgPoolBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PgPoolBuilder
impl RefUnwindSafe for PgPoolBuilder
impl Send for PgPoolBuilder
impl Sync for PgPoolBuilder
impl Unpin 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