Skip to main content

AttemptOutcome

Struct AttemptOutcome 

Source
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: u32

Attempt that finished (1 = the first try).

§redirect_hop: u32

Redirect 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.

Trait Implementations§

Source§

impl Clone for AttemptOutcome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttemptOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.