#[non_exhaustive]pub struct Limits {Show 13 fields
pub max_discovery_bytes: usize,
pub max_json_bytes: usize,
pub max_artifact_bytes: usize,
pub max_redirects: usize,
pub request_timeout: Duration,
pub download_timeout: Duration,
pub idle_timeout: Duration,
pub connect_timeout: Duration,
pub max_retries: u32,
pub max_retry_after: Duration,
pub max_discovery_attempts: u32,
pub initial_backoff: Duration,
pub max_in_flight: usize,
}Expand description
Bounds for untrusted TEA responses.
#[non_exhaustive]: start from Limits::default and use the with_*
setters (or assign fields on a default value).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_discovery_bytes: usizeMaximum .well-known/tea document size.
max_json_bytes: usizeMaximum JSON API response size.
max_artifact_bytes: usizeMaximum artifact or signature size, before and after content decoding.
max_redirects: usizeMaximum redirects for one operation.
request_timeout: DurationOverall time for one request that is not an artifact download: the
response headers and the whole body (discovery, JSON metadata, the token
exchange). Artifact GETs use Self::download_timeout instead.
download_timeout: DurationOverall time for one artifact or signature download, body included.
A transfer that keeps making progress is not cut off by the shorter
Self::request_timeout; this is the ceiling for the whole transfer.
Default 30 minutes.
idle_timeout: DurationLongest the connection may stay silent: the limit on any single wait for the next bytes of a response, for every request. A stalled transfer fails after this long even if the total time has not run out. Default 30 seconds. Must not be zero.
connect_timeout: DurationTCP connect timeout.
max_retries: u32Extra attempts for idempotent GET transport failures, HTTP 429 and HTTP 503.
max_retry_after: DurationLongest Retry-After the client will wait out before retrying a 429
or 503. A longer one fails at once with ClientError::Throttled,
which carries the server’s value.
max_discovery_attempts: u32Total discovery attempts across the well-known fetch and API candidates.
initial_backoff: DurationBase delay between discovery attempts. Zero disables the delay.
max_in_flight: usizeMaximum concurrent HTTP operations.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn with_max_discovery_bytes(self, value: usize) -> Self
pub fn with_max_discovery_bytes(self, value: usize) -> Self
Sourcepub fn with_max_json_bytes(self, value: usize) -> Self
pub fn with_max_json_bytes(self, value: usize) -> Self
Set Self::max_json_bytes.
Sourcepub fn with_max_artifact_bytes(self, value: usize) -> Self
pub fn with_max_artifact_bytes(self, value: usize) -> Self
Sourcepub fn with_max_redirects(self, value: usize) -> Self
pub fn with_max_redirects(self, value: usize) -> Self
Set Self::max_redirects.
Sourcepub fn with_request_timeout(self, value: Duration) -> Self
pub fn with_request_timeout(self, value: Duration) -> Self
Sourcepub fn with_download_timeout(self, value: Duration) -> Self
pub fn with_download_timeout(self, value: Duration) -> Self
Sourcepub fn with_idle_timeout(self, value: Duration) -> Self
pub fn with_idle_timeout(self, value: Duration) -> Self
Set Self::idle_timeout.
Sourcepub fn with_connect_timeout(self, value: Duration) -> Self
pub fn with_connect_timeout(self, value: Duration) -> Self
Sourcepub fn with_max_retries(self, value: u32) -> Self
pub fn with_max_retries(self, value: u32) -> Self
Set Self::max_retries.
Sourcepub fn with_max_discovery_attempts(self, value: u32) -> Self
pub fn with_max_discovery_attempts(self, value: u32) -> Self
Sourcepub fn with_initial_backoff(self, value: Duration) -> Self
pub fn with_initial_backoff(self, value: Duration) -> Self
Sourcepub fn with_max_retry_after(self, value: Duration) -> Self
pub fn with_max_retry_after(self, value: Duration) -> Self
Sourcepub fn with_max_in_flight(self, value: usize) -> Self
pub fn with_max_in_flight(self, value: usize) -> Self
Set Self::max_in_flight.