pub struct Abort { /* private fields */ }Expand description
A handle to abort requests.
Requests are either aborted based on reaching thresholds such as maximum response size, timeouts or too many redirects, or else they can be aborted explicitly by the calling code.
Implementations§
Source§impl Abort
impl Abort
Sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
True if abort has been invoked.
Sourcepub fn max_duration(&self) -> Duration
pub fn max_duration(&self) -> Duration
The maximum total time, including redirects.
Sourcepub fn max_redirects(&self) -> usize
pub fn max_redirects(&self) -> usize
The maximum number of redirects to allow.
Sourcepub fn with_max_size(self, n: usize) -> Abort
pub fn with_max_size(self, n: usize) -> Abort
Set the maximum reponse body size.
Sourcepub fn with_max_duration(self, d: Duration) -> Abort
pub fn with_max_duration(self, d: Duration) -> Abort
Set the maximum duration (including redirects).
Sourcepub fn with_max_redirects(self, n: usize) -> Abort
pub fn with_max_redirects(self, n: usize) -> Abort
Set the maximum number of redirects to follow.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Abort
impl RefUnwindSafe for Abort
impl Send for Abort
impl Sync for Abort
impl Unpin for Abort
impl UnwindSafe for Abort
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more