Skip to main content

Module retry

Module retry 

Source
Expand description

Retry policies for transport and HTTP failures.

Configure on ClientBuilder::retry or per-request RequestBuilder::retry.

On RequestBuilder::send_stream, HTTP retries use status and headers without reading the body. When a custom ShouldRetryFn is set, the client peeks up to ClientBuilder::retry_body_peek_bytes (default 64 KiB, capped by ClientBuilder::max_response_bytes when set). The peek is replayed on the stream returned to the caller; only a confirmed retry or RequestBuilder::throw_on_error(true) drains the body.

Enums§

RetryPolicy
Retry policy configuration.

Functions§

default_should_retry
Default HTTP status codes that trigger a retry when no custom predicate is set.
parse_retry_after
Parses Retry-After as a delay.

Type Aliases§

ShouldRetryFn
Predicate for whether a response should be retried.