pub struct ConnectOptions { /* private fields */ }Expand description
Options for Connect operation.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn with_user(
self,
name: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_user( self, name: impl Into<String>, password: impl Into<String>, ) -> Self
name is the identifier for the distributed shared lock to be acquired.
Sourcepub fn with_tls(self, tls: TlsOptions) -> Self
Available on crate features tls-aws-lc or tls-ring only.
pub fn with_tls(self, tls: TlsOptions) -> Self
tls-aws-lc or tls-ring only.Sets TLS options.
Notes that this function have to work with HTTPS URLs.
Sourcepub fn with_keep_alive(self, interval: Duration, timeout: Duration) -> Self
pub fn with_keep_alive(self, interval: Duration, timeout: Duration) -> Self
Enable HTTP2 keep-alive with interval and timeout.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Apply a timeout to each request.
Sourcepub fn with_connect_timeout(self, timeout: Duration) -> Self
pub fn with_connect_timeout(self, timeout: Duration) -> Self
Apply a timeout to connecting to the endpoint.
Sourcepub fn with_tcp_keepalive(self, tcp_keepalive: Duration) -> Self
pub fn with_tcp_keepalive(self, tcp_keepalive: Duration) -> Self
Enable TCP keepalive.
Sourcepub fn with_keep_alive_while_idle(self, enabled: bool) -> Self
pub fn with_keep_alive_while_idle(self, enabled: bool) -> Self
Whether send keep alive pings even there are no active requests.
If disabled, keep-alive pings are only sent while there are opened request/response streams.
If enabled, pings are also sent when no streams are active.
NOTE: Some implementations of gRPC server may send GOAWAY if there are too many pings.
This would be useful if you meet some error like too many pings.
Sourcepub fn with_require_leader(self, require_leader: bool) -> Self
pub fn with_require_leader(self, require_leader: bool) -> Self
Whether to enforce that a leader be present in the etcd cluster.
Sourcepub fn with_auto_token_refresh(self, refresh_expired_token: bool) -> Self
pub fn with_auto_token_refresh(self, refresh_expired_token: bool) -> Self
Whether to automatically refresh the authentication token when the current token has expired. Note that, when this feature is enabled, each request is CLONED so that it can be retried.
Concurrent requests which find the token expired refresh it once. If the refresh keeps failing, e.g. the password of the user was changed, the requests waiting for it authenticate one after another and each of them fails, so the last one waits for about as many round trips as there are requests.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnsafeUnpin for ConnectOptions
impl UnwindSafe for ConnectOptions
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
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: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request