pub struct ClientConfig {
pub base_url: String,
pub timeout_ms: u64,
pub pool_size: usize,
pub retry_config: Option<RetryConfig>,
pub max_concurrent: Option<usize>,
/* private fields */
}Expand description
The transport settings a client builder holds: the base URL, the timeout, the connection pool, the retry schedule and the concurrency budget.
A venue’s builder holds one, generates its five setters with
client_config_setters!, and builds its
HttpClient from http_builder,
adding the throttle and the retry policy it installs itself. The config
holds no throttle, policy or gzip setting, since those belong to the
venue.
Fields§
§base_url: StringThe API’s base URL.
timeout_ms: u64Request timeout in milliseconds.
pool_size: usizeIdle connections kept per host.
retry_config: Option<RetryConfig>The retry schedule; None keeps RetryConfig::default.
max_concurrent: Option<usize>In-flight requests allowed; None keeps the client’s default.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new(base_url: impl Into<String>, default_max_concurrent: usize) -> Self
pub fn new(base_url: impl Into<String>, default_max_concurrent: usize) -> Self
A config for base_url with core’s default timeout and pool size, no
retry config of its own, and default_max_concurrent in-flight
requests unless max_concurrent is set.
Sourcepub fn http_builder(&self) -> HttpClientBuilder
pub fn http_builder(&self) -> HttpClientBuilder
An HttpClientBuilder for the base URL, with the timeout, the pool
size, the concurrency (the set value, else the client’s default) and
the retry config if one is set. It sets no throttle, policy or gzip.