pub struct PgConfig { /* private fields */ }Expand description
Postgres configuration
Implementations§
Source§impl PgConfig
impl PgConfig
Sourcepub fn new(
conn_str: &str,
tls_mode: Option<&str>,
max_connections: Option<usize>,
connection_timeout_secs: Option<u64>,
) -> Self
pub fn new( conn_str: &str, tls_mode: Option<&str>, max_connections: Option<usize>, connection_timeout_secs: Option<u64>, ) -> Self
Create a new PgConfig with explicit TLS mode, pool size, and timeout.
tls_mode accepts the same strings as the configuration file:
"disable", "prefer", "allow", "require", "verify-ca",
"verify-full". When None, the TLS mode is inferred from
sslmode= in the connection URL (matching the old behaviour).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PgConfig
impl RefUnwindSafe for PgConfig
impl Send for PgConfig
impl Sync for PgConfig
impl Unpin for PgConfig
impl UnsafeUnpin for PgConfig
impl UnwindSafe for PgConfig
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