pub struct CurlConfig {
pub connect_timeout: Duration,
pub total_timeout: Duration,
pub max_redirects: usize,
pub follow_redirects: bool,
pub allowed_protocols: Vec<String>,
pub proxy: CurlProxy,
}Expand description
Strict transport configuration. All policy lives here.
Fields§
§connect_timeout: DurationConnect deadline ceiling.
total_timeout: DurationTotal deadline ceiling.
max_redirects: usizeRedirect bound when following is enabled.
follow_redirects: boolWhether HTTP redirects are followed.
allowed_protocols: Vec<String>Allowed URL protocols (default http, https).
This list bounds the initial request. The redirect target set is
narrowed further: an https request never follows a redirect down to
http, so a 302 Location: http://... is refused rather than followed
in cleartext.
proxy: CurlProxyProxy routing decision.
Implementations§
Source§impl CurlConfig
impl CurlConfig
Sourcepub fn timeouts(self, connect: Duration, total: Duration) -> Self
pub fn timeouts(self, connect: Duration, total: Duration) -> Self
Sets connect/total adapter ceilings.
These are ceilings, not defaults: the effective deadline for one fetch
is min(request, adapter ceiling) (see FetchLimits::effective).
Sourcepub fn max_redirects(self, max: usize) -> Self
pub fn max_redirects(self, max: usize) -> Self
Sets the redirect bound.
Sourcepub fn follow_redirects(self, follow: bool) -> Self
pub fn follow_redirects(self, follow: bool) -> Self
Sets whether redirects are followed.
Sourcepub fn allowed_protocols(self, protocols: Vec<String>) -> Self
pub fn allowed_protocols(self, protocols: Vec<String>) -> Self
Sets the allowed protocols.
Sourcepub fn effective_timeouts(&self, limits: FetchLimits) -> (Duration, Duration)
pub fn effective_timeouts(&self, limits: FetchLimits) -> (Duration, Duration)
Derives the authoritative effective deadlines for one fetch.