Struct Attempt

pub struct Attempt<'a> { /* private fields */ }

A type that holds information on the next request and previous requests in redirect chain.

Implementations

impl<'a> Attempt<'a>

fn status(&self) -> StatusCode

Get the type of redirect.

fn url(&self) -> &Url

Get the next URL to redirect to.

fn previous(&self) -> &[Url]

Get the list of previous URLs that have already been requested in this chain.

fn follow(self) -> Action

Returns an action meaning reqwest should follow the next URL.

fn stop(self) -> Action

Returns an action meaning reqwest should not follow the next URL.

The 30x response will be returned as the Ok result.

fn error<E: Into<Box<dyn StdError + Send + Sync>>>(self, error: E) -> Action

Returns an action failing the redirect with an error.

The Error will be returned for the result of the sent request.

Trait Implementations

impl<'a> Debug for Attempt<'a>

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

Auto Trait Implementations

impl<'a> Freeze for Attempt<'a>

impl<'a> RefUnwindSafe for Attempt<'a>

impl<'a> Send for Attempt<'a>

impl<'a> Sync for Attempt<'a>

impl<'a> Unpin for Attempt<'a>

impl<'a> UnsafeUnpin for Attempt<'a>

impl<'a> UnwindSafe for Attempt<'a>

Blanket Implementations

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

impl<T> Borrow<T> for Attempt<'a> where T: ?Sized,

impl<T> BorrowMut<T> for Attempt<'a> where T: ?Sized,

impl<T> From<T> for Attempt<'a>

impl<T> Instrument for Attempt<'a>

impl<T> PolicyExt for Attempt<'a> where T: ?Sized,

impl<T> WithSubscriber for Attempt<'a>

impl<T, U> Into<U> for Attempt<'a> where U: From<T>,

impl<T, U> TryFrom<U> for Attempt<'a> where U: Into<T>,

impl<T, U> TryInto<U> for Attempt<'a> where U: TryFrom<T>,