pub struct ConnectionConfig {
pub url: String,
pub connect_timeout_ms: u64,
pub query_timeout_ms: u64,
pub ssl_mode: SslMode,
pub application_name: Option<String>,
}Expand description
Configuration for database connections.
Fields§
§url: StringConnection string or URL
connect_timeout_ms: u64Connection timeout in milliseconds
query_timeout_ms: u64Query timeout in milliseconds
ssl_mode: SslModeSSL mode
application_name: Option<String>Application name for connection identification
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn connect_timeout(self, ms: u64) -> Self
pub fn connect_timeout(self, ms: u64) -> Self
Set the connection timeout.
Sourcepub fn query_timeout(self, ms: u64) -> Self
pub fn query_timeout(self, ms: u64) -> Self
Set the query timeout.
Sourcepub fn application_name(self, name: impl Into<String>) -> Self
pub fn application_name(self, name: impl Into<String>) -> Self
Set the application name.
Trait Implementations§
Source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
Source§fn clone(&self) -> ConnectionConfig
fn clone(&self) -> ConnectionConfig
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 moreSource§impl Debug for ConnectionConfig
impl Debug for ConnectionConfig
Auto Trait Implementations§
impl Freeze for ConnectionConfig
impl RefUnwindSafe for ConnectionConfig
impl Send for ConnectionConfig
impl Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl UnwindSafe for ConnectionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).