pub struct NetworkConfig {
pub proxy_url: Option<String>,
pub https_proxy_url: Option<String>,
pub no_proxy: Option<String>,
pub connect_timeout_seconds: u64,
pub read_timeout_seconds: u64,
pub request_timeout_seconds: u64,
pub pool_idle_timeout_seconds: u64,
pub pool_max_idle_per_host: usize,
pub correlation_id_header: String,
pub enable_correlation_ids: bool,
}Expand description
Network configuration for HTTP client behavior.
Controls proxy settings, timeouts, and connection pooling. All fields have sensible defaults suitable for most deployments.
§Example
[network]
proxy_url = "http://proxy.corp.example.com:8080"
connect_timeout_seconds = 10
read_timeout_seconds = 30
correlation_id_header = "X-Correlation-ID"Fields§
§proxy_url: Option<String>HTTP proxy URL for corporate networks.
When set, all HTTP requests will be routed through this proxy. Supports HTTP and HTTPS proxy URLs.
§Example
http://proxy.corp.example.com:8080https_proxy_url: Option<String>HTTPS proxy URL (if different from HTTP proxy).
When set, HTTPS requests use this proxy while HTTP requests
use proxy_url. If not set, proxy_url is used for all requests.
no_proxy: Option<String>Hostnames to bypass proxy (comma-separated).
Requests to these hosts will not use the proxy.
§Example
localhost,127.0.0.1,.internal.corpconnect_timeout_seconds: u64TCP connection timeout in seconds.
Maximum time to wait for establishing a TCP connection. Default: 10 seconds
read_timeout_seconds: u64HTTP response read timeout in seconds.
Maximum time to wait for reading the response body after headers are received. Default: 30 seconds
request_timeout_seconds: u64Overall request timeout in seconds.
Maximum total time for a complete request/response cycle. Default: 30 seconds
pool_idle_timeout_seconds: u64Connection pool idle timeout in seconds.
How long idle connections are kept in the pool before closing. Default: 30 seconds
pool_max_idle_per_host: usizeMaximum idle connections per host.
Maximum number of idle connections kept open to each host. Default: 5
correlation_id_header: StringCustom header name for correlation IDs.
When set, the SDK will add this header to all requests with a unique correlation ID for request tracing.
Default: “X-Request-ID”
enable_correlation_ids: boolEnable correlation ID generation.
When true, the SDK generates and attaches correlation IDs to all HTTP requests for tracing purposes. Default: true
Implementations§
Source§impl NetworkConfig
impl NetworkConfig
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more