pub struct TransportConfig {
pub ssl_mode: SslMode,
pub ssl_root_cert: Option<PathBuf>,
pub retries: u32,
pub connect_timeout_secs: u32,
pub statement_timeout_secs: u32,
pub keepalive_secs: u32,
}Expand description
Transport-level connection settings: how to reach the server and how much to trust it.
Introduced to stop the connect helpers growing another positional argument
— connect_with_full_config already took six, and TLS trust needs two
more. Build one with TransportConfig::from_database_config.
Fields§
§ssl_mode: SslModeTLS mode; see SslMode for the ladder.
ssl_root_cert: Option<PathBuf>PEM file of CA certificates that replaces the built-in trust store.
retries: u32Connection attempts to retry before giving up.
connect_timeout_secs: u32Per-attempt connection timeout in seconds (0 disables).
statement_timeout_secs: u32statement_timeout to set once connected (0 leaves it alone).
keepalive_secs: u32TCP keepalive interval in seconds (0 disables).
Implementations§
Source§impl TransportConfig
impl TransportConfig
Sourcepub fn from_database_config(db: &DatabaseConfig) -> Self
pub fn from_database_config(db: &DatabaseConfig) -> Self
Extract the transport settings from a loaded [database] config.
Trait Implementations§
Source§impl Clone for TransportConfig
impl Clone for TransportConfig
Source§fn clone(&self) -> TransportConfig
fn clone(&self) -> TransportConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransportConfig
impl Debug for TransportConfig
Auto Trait Implementations§
impl Freeze for TransportConfig
impl RefUnwindSafe for TransportConfig
impl Send for TransportConfig
impl Sync for TransportConfig
impl Unpin for TransportConfig
impl UnsafeUnpin for TransportConfig
impl UnwindSafe for TransportConfig
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