pub struct ClientConfig {
pub connect_timeout: Duration,
pub call_timeout: Duration,
pub credentials: Option<Credentials>,
pub client_name: Option<String>,
}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).
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
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 ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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