pub struct HttpClientConfigBuilder { /* private fields */ }Expand description
Builder for creating HttpClientConfig instances.
Provides a fluent API for configuring HTTP client behavior.
§Example
ⓘ
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)))
.build();Implementations§
Source§impl HttpClientConfigBuilder
impl HttpClientConfigBuilder
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Set the maximum number of retry attempts
Sourcepub fn compression(self, enable: bool) -> Self
pub fn compression(self, enable: bool) -> Self
Enable or disable gzip compression
Sourcepub fn retry_delay(self, delay: RetryDelay) -> Self
pub fn retry_delay(self, delay: RetryDelay) -> Self
Set the retry delay strategy
Sourcepub fn mask_sensitive_data(self, enable: bool) -> Self
pub fn mask_sensitive_data(self, enable: bool) -> Self
Enable or disable sensitive data masking in logs
Sourcepub fn build(self) -> HttpClientConfig
pub fn build(self) -> HttpClientConfig
Build the configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpClientConfigBuilder
impl RefUnwindSafe for HttpClientConfigBuilder
impl Send for HttpClientConfigBuilder
impl Sync for HttpClientConfigBuilder
impl Unpin for HttpClientConfigBuilder
impl UnsafeUnpin for HttpClientConfigBuilder
impl UnwindSafe for HttpClientConfigBuilder
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