pub struct AbortSignal { /* private fields */ }Expand description
A cancellation signal analogous to the Web AbortSignal.
Rust has no built-in AbortSignal; this is a minimal, dependency-free
implementation backed by an Arc<AtomicBool>. Providers that want true
async cancellation should poll AbortSignal::is_aborted (e.g. inside a
tokio::select! arm) or check it between request steps. Callers obtain a
signal, hand out clones, and call AbortSignal::abort to request
cancellation.
This type is Send + Sync and cheap to clone (a single Arc).
Implementations§
Trait Implementations§
Source§impl Clone for AbortSignal
impl Clone for AbortSignal
Source§fn clone(&self) -> AbortSignal
fn clone(&self) -> AbortSignal
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AbortSignal
impl Debug for AbortSignal
Source§impl Default for AbortSignal
impl Default for AbortSignal
Source§fn default() -> AbortSignal
fn default() -> AbortSignal
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AbortSignal
impl RefUnwindSafe for AbortSignal
impl Send for AbortSignal
impl Sync for AbortSignal
impl Unpin for AbortSignal
impl UnsafeUnpin for AbortSignal
impl UnwindSafe for AbortSignal
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