pub struct PostgresProvider { /* private fields */ }Implementations§
Source§impl PostgresProvider
impl PostgresProvider
Sourcepub fn new(connection_string: &str, pool_size: usize) -> EFResult<Self>
pub fn new(connection_string: &str, pool_size: usize) -> EFResult<Self>
Creates a provider with TLS required (secure-by-default, v1.6+).
Uses a native_tls::TlsConnector built from the platform’s default
root certificate store. For plaintext connections (local dev only),
use PostgresProvider::new_insecure. For custom CA certificates,
use PostgresProvider::new_with_tls.
Sourcepub fn new_insecure(connection_string: &str, pool_size: usize) -> EFResult<Self>
pub fn new_insecure(connection_string: &str, pool_size: usize) -> EFResult<Self>
Creates a provider with TLS disabled (plaintext, local dev only).
Sourcepub fn new_with_tls(
connection_string: &str,
pool_size: usize,
tls: PgTlsMode,
) -> EFResult<Self>
pub fn new_with_tls( connection_string: &str, pool_size: usize, tls: PgTlsMode, ) -> EFResult<Self>
Creates a provider with configurable TLS.
PgTlsMode::Disable is equivalent to PostgresProvider::new_insecure.
PgTlsMode::Require(connector) enforces TLS for all pooled connections.
The TLS connector type is erased inside deadpool_postgres::Manager
(via Box<dyn Connect>), so Pool and [PostgresConnection] are
non-generic — TLS configuration is a per-pool construction-time
decision, not a type-level parameter.