pub struct HttpClientConfigBuilder { /* private fields */ }Expand description
Builder for HTTP client configuration.
Implementations§
Source§impl HttpClientConfigBuilder
impl HttpClientConfigBuilder
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the connection timeout.
Sourcepub fn retry(self, config: RetryConfig) -> Self
pub fn retry(self, config: RetryConfig) -> Self
Set retry configuration.
Sourcepub fn circuit_breaker(self, config: CircuitBreakerConfig) -> Self
pub fn circuit_breaker(self, config: CircuitBreakerConfig) -> Self
Set circuit breaker configuration.
Sourcepub fn pool_idle_timeout(self, timeout: Duration) -> Self
pub fn pool_idle_timeout(self, timeout: Duration) -> Self
Set the connection pool idle timeout.
Sourcepub fn pool_max_idle_per_host(self, max: usize) -> Self
pub fn pool_max_idle_per_host(self, max: usize) -> Self
Set the maximum idle connections per host.
Sourcepub fn default_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn default_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a default header for all requests.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Set the user agent string.
Sourcepub fn follow_redirects(self, enable: bool) -> Self
pub fn follow_redirects(self, enable: bool) -> Self
Enable or disable following redirects.
Sourcepub fn max_redirects(self, max: usize) -> Self
pub fn max_redirects(self, max: usize) -> Self
Set the maximum number of redirects to follow.
Sourcepub fn build(self) -> HttpClientConfig
pub fn build(self) -> HttpClientConfig
Build the configuration.
Trait Implementations§
Source§impl Debug for HttpClientConfigBuilder
impl Debug for HttpClientConfigBuilder
Source§impl Default for HttpClientConfigBuilder
impl Default for HttpClientConfigBuilder
Source§fn default() -> HttpClientConfigBuilder
fn default() -> HttpClientConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HttpClientConfigBuilder
impl RefUnwindSafe for HttpClientConfigBuilder
impl Send for HttpClientConfigBuilder
impl Sync for HttpClientConfigBuilder
impl Unpin 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