pub struct AttemptOutcome {
pub url: String,
pub method: Method,
pub attempt: u32,
pub redirect_hop: u32,
pub status: Option<u16>,
pub headers: Vec<(String, String)>,
pub error_class: Option<ErrorClass>,
pub error_phase: Option<Phase>,
pub error: Option<String>,
pub delivery: AttemptDelivery,
pub next_delay: Option<Duration>,
}Expand description
One finished transport hop, reported to Client::on_attempt_outcome exactly once
per physical transport attempt that passed the ClientConfig::on_attempt gate, including the
terminal one. It is observed before the response body is read. Sanitized like every
other event surface: url has configured and per-request secret values replaced by
[redacted] and any query or userinfo removed, headers are a copy with
credential-named values (including Set-Cookie and Authorization) replaced and
recorded secret values scrubbed, error text is scrubbed the same way, and no body
ever appears. attempt groups redirect hops within one retry. delivery describes
only this hop (a refused connect on a redirect hop is NotSent for that hop): a later
NotSent never makes an earlier responded POST safe to replay, and the call’s error and
retry decision still treat the whole redirect chain as possibly delivered.
Redirect responses report before target validation; their next_delay is None.
Only the final hop can carry a retry delay. A pre-send validation or policy refusal
reports no outcome; earlier hop outcomes remain available.
Fields§
§url: String§method: Method§attempt: u32Attempt that finished (1 = the first try).
redirect_hop: u32Redirect hop within this logical attempt (0 = initial request).
status: Option<u16>Response status when the server answered.
headers: Vec<(String, String)>Copied, redacted response headers (lower-cased names); empty when no response.
error_class: Option<ErrorClass>Typed class of the failure, when the attempt failed without a response.
error_phase: Option<Phase>Phase of a timeout/transport failure.
error: Option<String>Scrubbed failure text.
delivery: AttemptDelivery§next_delay: Option<Duration>Delay before the next logical attempt. Only its final hop carries this value;
None also covers intermediate redirects, success, unretryable outcomes,
exhausted budgets, or a passed deadline.