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
sourceimpl 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
sourceimpl From<Arc<AtomicBool>> for Abort
impl From<Arc<AtomicBool>> for Abort
sourcefn from(a: Arc<AtomicBool>) -> Abort
fn from(a: Arc<AtomicBool>) -> Abort
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Abort
impl Send for Abort
impl Sync for Abort
impl Unpin for Abort
impl UnwindSafe for Abort
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more