pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for Config.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn host(self, host: impl Into<String>) -> Self
pub fn host(self, host: impl Into<String>) -> Self
Append a host with the current default port.
Sourcepub fn host_port(self, host: impl Into<String>, port: u16) -> Self
pub fn host_port(self, host: impl Into<String>, port: u16) -> Self
Append a host with a specific port.
Sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Set the default port for subsequent .host() calls and update
any hosts that still have the old default port.
pub fn load_balance_hosts(self, strategy: LoadBalanceHosts) -> Self
pub fn database(self, database: impl Into<String>) -> Self
pub fn user(self, user: impl Into<String>) -> Self
pub fn password(self, password: impl Into<String>) -> Self
pub fn ssl_mode(self, ssl_mode: SslMode) -> Self
pub fn application_name(self, name: impl Into<String>) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
pub fn statement_timeout(self, timeout: Duration) -> Self
pub fn keepalive(self, interval: Duration) -> Self
pub fn target_session_attrs(self, attrs: TargetSessionAttrs) -> Self
Sourcepub fn ssl_client_cert(self, path: impl Into<PathBuf>) -> Self
pub fn ssl_client_cert(self, path: impl Into<PathBuf>) -> Self
Set the path to the client certificate file for certificate authentication.
Sourcepub fn ssl_client_key(self, path: impl Into<PathBuf>) -> Self
pub fn ssl_client_key(self, path: impl Into<PathBuf>) -> Self
Set the path to the client private key file for certificate authentication.
Sourcepub fn ssl_direct(self, direct: bool) -> Self
pub fn ssl_direct(self, direct: bool) -> Self
Enable direct TLS connection (PG 17+), skipping SSLRequest negotiation.
Sourcepub fn channel_binding(self, binding: ChannelBinding) -> Self
pub fn channel_binding(self, binding: ChannelBinding) -> Self
Set the channel binding preference for SCRAM authentication.
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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