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) -> StatusCodeGet the type of redirect.
fn url(&self) -> &UrlGet 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) -> ActionReturns an action meaning reqwest should follow the next URL.
fn stop(self) -> ActionReturns an action meaning reqwest should not follow the next URL.
The 30x response will be returned as the
Okresult.fn error<E: Into<Box<dyn StdError + Send + Sync>>>(self, error: E) -> ActionReturns an action failing the redirect with an error.
The
Errorwill 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) -> TReturns 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) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses 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>