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.
Fields§
§base_url: Url§timeout: Option<Duration>§retry: Option<RetryPolicy>§auth: Option<Auth>§default_headers: HeaderMap§hooks: Hooks§plugins: Arc<PluginRegistry>§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>Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClientConfig
impl !RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more