pub struct HttpClientConfig {
pub timeout: Duration,
pub max_retries: u32,
pub enable_compression: bool,
pub retry_delay: RetryDelay,
pub enable_logging: bool,
pub mask_sensitive_data: bool,
}Expand description
Configuration for HTTP client behavior.
Use the builder pattern for fluent configuration:
ⓘ
use zai_rs::client::http::HttpClientConfig;
let config = HttpClientConfig::builder()
.max_retries(5)
.timeout(Duration::from_secs(120))
.retry_delay(RetryDelay::exponential(Duration::from_millis(100), Duration::from_secs(10)))
.enable_logging(true)
.build();Fields§
§timeout: DurationRequest timeout duration (default: 60 seconds)
max_retries: u32Maximum number of retry attempts (default: 3)
enable_compression: boolEnable gzip compression (default: true)
retry_delay: RetryDelayRetry delay strategy
enable_logging: boolEnable detailed logging (default: false)
mask_sensitive_data: boolEnable sensitive data masking in logs (default: true)
Implementations§
Source§impl HttpClientConfig
impl HttpClientConfig
Sourcepub fn builder() -> HttpClientConfigBuilder
pub fn builder() -> HttpClientConfigBuilder
Create a new builder for fluent configuration
Trait Implementations§
Source§impl Clone for HttpClientConfig
impl Clone for HttpClientConfig
Source§fn clone(&self) -> HttpClientConfig
fn clone(&self) -> HttpClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpClientConfig
impl Debug for HttpClientConfig
Auto Trait Implementations§
impl Freeze for HttpClientConfig
impl RefUnwindSafe for HttpClientConfig
impl Send for HttpClientConfig
impl Sync for HttpClientConfig
impl Unpin for HttpClientConfig
impl UnsafeUnpin for HttpClientConfig
impl UnwindSafe for HttpClientConfig
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