pub struct ClientConfig {
pub id: u32,
pub connect_timeout: Duration,
pub request_timeout: Duration,
pub tcp_keepalive: Duration,
pub http2_keepalive_interval: Duration,
pub http2_keepalive_timeout: Duration,
pub max_frame_size: u32,
pub enable_compression: bool,
}
Expand description
Client configuration parameters for network connection management
Encapsulates all tunable settings for establishing and maintaining network connections, including timeouts, keepalive policies, and performance-related options.
§Key Configuration Areas
- Connection establishment (TCP handshake timeout)
- Request/response lifecycle control
- HTTP/2 protocol optimization
- Network efficiency settings (compression, frame sizing)
Fields§
§id: u32
Client id representation
connect_timeout: Duration
Maximum time to wait for establishing a TCP connection Default: 1 second
request_timeout: Duration
Maximum time to wait for a complete RPC response Default: 3 seconds
tcp_keepalive: Duration
TCP keepalive duration for idle connections Default: 5 minutes (300s)
http2_keepalive_interval: Duration
Interval for HTTP/2 keepalive pings Default: 1 minute (60s)
http2_keepalive_timeout: Duration
Timeout for HTTP/2 keepalive pings Default: 20 seconds
max_frame_size: u32
Maximum size of a single HTTP/2 frame in bytes Recommended: 1MB (1048576) to 16MB (16777215) Default: 1MB
enable_compression: bool
Enable Gzip compression for network traffic Tradeoff: Reduces bandwidth usage at the cost of CPU Default: true (enabled)
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 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
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