pub struct ClientConfig {
pub base_url: Url,
pub timeout: Option<Duration>,
pub retry: Option<RetryPolicy>,
pub auth: Option<Auth>,
pub default_headers: HeaderMap,
pub hooks: Hooks,
pub plugins: Arc<PluginRegistry>,
pub max_in_flight: Option<Arc<Semaphore>>,
pub json_parser: Option<JsonParserFn>,
/* private fields */
}Expand description
Shared client configuration (returned by Client::config).
Fields§
§base_url: UrlBase URL joined with request paths.
timeout: Option<Duration>Default per-request timeout when the builder does not override it.
retry: Option<RetryPolicy>Default retry policy for requests that do not set their own.
auth: Option<Auth>Default authentication applied when a request has no per-request auth.
default_headers: HeaderMapHeaders merged into every request unless overridden.
hooks: HooksClient-level lifecycle hooks (merged with plugin hooks at build time).
plugins: Arc<PluginRegistry>Registered plugins (init hooks + merged hook chains).
max_in_flight: Option<Arc<Semaphore>>Limits concurrent in-flight requests for this client (including retries).
This is separate from Tower’s ConcurrencyLimitLayer:
the client semaphore applies to the full request lifecycle (hooks + retries), while Tower
limits only transport-layer concurrency. Avoid stacking both without accounting for that.
json_parser: Option<JsonParserFn>Client-wide custom JSON parser (feature json).
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more