pub struct TimeoutConfig {
pub connect_timeout: Duration,
pub tls_timeout: Duration,
pub login_timeout: Duration,
pub command_timeout: Duration,
pub idle_timeout: Duration,
pub keepalive_interval: Option<Duration>,
}Expand description
Timeout configuration for various connection phases.
Per ARCHITECTURE.md §4.4, different phases of connection and command execution have separate timeout controls.
Fields§
§connect_timeout: DurationTime to establish TCP connection (default: 15s).
tls_timeout: DurationTime to complete TLS handshake (default: 10s).
login_timeout: DurationTime to complete login sequence (default: 30s).
command_timeout: DurationDefault timeout for command execution (default: 30s).
Applied to every query/execute call: if the server does not return
a complete response within this duration, the driver sends an Attention
packet to cancel the command, drains the acknowledgement, and returns
Error::CommandTimeout with the
connection left usable. Set to Duration::ZERO for no limit (matching
ADO.NET’s CommandTimeout = 0).
idle_timeout: DurationTime before idle connection is closed (default: 300s).
keepalive_interval: Option<Duration>Interval for connection keep-alive (default: 30s).
Implementations§
Source§impl TimeoutConfig
impl TimeoutConfig
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the TCP connection timeout.
Sourcepub fn tls_timeout(self, timeout: Duration) -> Self
pub fn tls_timeout(self, timeout: Duration) -> Self
Set the TLS handshake timeout.
Sourcepub fn login_timeout(self, timeout: Duration) -> Self
pub fn login_timeout(self, timeout: Duration) -> Self
Set the login sequence timeout.
Sourcepub fn command_timeout(self, timeout: Duration) -> Self
pub fn command_timeout(self, timeout: Duration) -> Self
Set the default command execution timeout.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set the idle connection timeout.
Sourcepub fn keepalive_interval(self, interval: Option<Duration>) -> Self
pub fn keepalive_interval(self, interval: Option<Duration>) -> Self
Set the keep-alive interval.
Sourcepub fn no_keepalive(self) -> Self
pub fn no_keepalive(self) -> Self
Disable keep-alive.
Sourcepub fn total_connect_timeout(&self) -> Duration
pub fn total_connect_timeout(&self) -> Duration
Get the total time allowed for a full connection (TCP + TLS + login).
Trait Implementations§
Source§impl Clone for TimeoutConfig
impl Clone for TimeoutConfig
Source§fn clone(&self) -> TimeoutConfig
fn clone(&self) -> TimeoutConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more