Struct reqwest::RedirectAttempt
source · [−]pub struct RedirectAttempt<'a> { /* private fields */ }
Expand description
A type that holds information on the next request and previous requests in redirect chain.
Implementations
sourceimpl<'a> RedirectAttempt<'a>
impl<'a> RedirectAttempt<'a>
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the type of redirect.
sourcepub fn previous(&self) -> &[Url]
pub fn previous(&self) -> &[Url]
Get the list of previous URLs that have already been requested in this chain.
sourcepub fn follow(self) -> RedirectAction
pub fn follow(self) -> RedirectAction
Returns an action meaning reqwest should follow the next URL.
sourcepub fn stop(self) -> RedirectAction
pub fn stop(self) -> RedirectAction
Returns an action meaning reqwest should not follow the next URL.
The 30x response will be returned as the Ok
result.
sourcepub fn loop_detected(self) -> RedirectAction
pub fn loop_detected(self) -> RedirectAction
Returns an action meaning there was a loop of redirects found.
An Error
will be returned for the result of the sent request.
sourcepub fn too_many_redirects(self) -> RedirectAction
pub fn too_many_redirects(self) -> RedirectAction
Returns an action meaning there was a loop of redirects found.
An Error
will be returned for the result of the sent request.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for RedirectAttempt<'a>
impl<'a> Send for RedirectAttempt<'a>
impl<'a> Sync for RedirectAttempt<'a>
impl<'a> Unpin for RedirectAttempt<'a>
impl<'a> UnwindSafe for RedirectAttempt<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more