pub struct HttpConfig { /* private fields */ }Expand description
Tunable policy for the HTTP/HTTPS source driver.
Build with HttpConfig::builder; finalised with
HttpConfigBuilder::build. A default HttpConfig matches the
library’s pre-r77 behaviour: ureq defaults, no extra restrictions,
Authorization stripped on redirect.
HttpConfig is a thin policy struct; it does not itself hold the
underlying agent. Either install one globally with
install_default_config (one-shot, before the first open call)
or pass to HttpSource::open_with_config per-request.
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub fn builder() -> HttpConfigBuilder
pub fn builder() -> HttpConfigBuilder
Start a builder pre-populated with the library defaults.
Sourcepub fn max_redirects(&self) -> u32
pub fn max_redirects(&self) -> u32
Maximum number of redirects the client will follow before giving up.
Sourcepub fn max_redirects_will_error(&self) -> bool
pub fn max_redirects_will_error(&self) -> bool
Whether exceeding Self::max_redirects surfaces as an error
(true) or returns the final 3xx response (false).
Sourcepub fn redirect_auth_policy(&self) -> RedirectAuthPolicy
pub fn redirect_auth_policy(&self) -> RedirectAuthPolicy
Redirect handling for the Authorization header.
Sourcepub fn user_agent(&self) -> Option<&str>
pub fn user_agent(&self) -> Option<&str>
Custom User-Agent header value, if set.
Sourcepub fn https_only(&self) -> bool
pub fn https_only(&self) -> bool
Whether to reject all http:// requests (including redirect
targets) at the agent level.
Sourcepub fn timeout_global(&self) -> Option<Duration>
pub fn timeout_global(&self) -> Option<Duration>
End-to-end timeout for an entire call (DNS through body read).
Sourcepub fn timeout_connect(&self) -> Option<Duration>
pub fn timeout_connect(&self) -> Option<Duration>
Maximum time to establish a connection (TCP + TLS handshake).
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more