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,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Attempt<'a>

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

fn and<P, B, E>(self, other: P) -> And<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,
fn or<P, B, E>(self, other: P) -> Or<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,

impl<T> WithSubscriber for Attempt<'a>

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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