pub struct ClientConfig {
pub connect_timeout: Duration,
pub call_timeout: Duration,
pub credentials: Option<Credentials>,
pub client_name: Option<String>,
pub tls: Option<ClientTls>,
}Expand description
Client configuration: connect timeout default 10 s (CLT-001), per-call timeout default 30 s (CLT-020), optional credentials and client name for the handshake (CLT-002).
Fields§
§connect_timeout: DurationTCP connect timeout (CLT-001). Default 10 s.
call_timeout: DurationDefault per-call timeout (CLT-020); override per call with
Client::call_with_timeout. Default 30 s.
credentials: Option<Credentials>Handshake credentials, when the configured handshake wants them.
client_name: Option<String>Client identifier sent in the HELLO map (HelloMandatory).
tls: Option<ClientTls>Optional TLS (FR-29 / SPEC-008 CAN-020). Some dials TLS; None (the
default) keeps plaintext. Requires the crate’s tls feature — a client
configured with TLS but built without it fails to connect with a
Connection error rather than silently dialing plaintext.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the connect timeout (CLT-001).
Sourcepub fn call_timeout(self, timeout: Duration) -> Self
pub fn call_timeout(self, timeout: Duration) -> Self
Set the default per-call timeout (CLT-020).
Sourcepub fn user_pass(self, user: impl Into<String>, pass: impl Into<String>) -> Self
pub fn user_pass(self, user: impl Into<String>, pass: impl Into<String>) -> Self
Authenticate with user + password (AuthCommand handshakes).
Sourcepub fn client_name(self, name: impl Into<String>) -> Self
pub fn client_name(self, name: impl Into<String>) -> Self
Set the client name announced in the HELLO map.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more