pub struct HttpClientBuilder { /* private fields */ }http only.Expand description
Builder for HttpClient.
Implementations§
Source§impl HttpClientBuilder
impl HttpClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new HttpClientBuilder with default User-Agent, timeout, mirror, and resilience policy.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Sets the User-Agent header used when building an internal reqwest::Client.
Sourcepub fn mirror(self, mirror: Mirror) -> Self
pub fn mirror(self, mirror: Mirror) -> Self
Configures the Mirror routing strategy applied to public read requests.
Sourcepub fn resilience(self, resilience: ResiliencePolicy) -> Self
pub fn resilience(self, resilience: ResiliencePolicy) -> Self
Configures the ResiliencePolicy (retries, backoff, and official fallback).
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the request timeout when building an internal reqwest::Client.
Sourcepub fn default_header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn default_header(self, name: HeaderName, value: HeaderValue) -> Self
Adds a default header when building an internal reqwest::Client.
Sourcepub fn reqwest_client(self, client: Client) -> Self
pub fn reqwest_client(self, client: Client) -> Self
Injects a pre-configured reqwest::Client (for connection pool sharing or custom TLS).
Note: user_agent, timeout, and default_header configure the internally constructed
reqwest::Client and are bypassed when an external reqwest::Client is provided.
Sourcepub fn build(self) -> Result<HttpClient>
pub fn build(self) -> Result<HttpClient>
Builds an HttpClient using the configured options.