pub struct AbortController { /* private fields */ }Expand description
The write end of an abort pair — fires the signal via
abort.
Cloneable: multiple controllers can share the same state through
clones, so any clone’s abort() fires the shared signal. Most
apps hold one and pass signals out.
Implementations§
Source§impl AbortController
impl AbortController
Sourcepub fn signal(&self) -> AbortSignal
pub fn signal(&self) -> AbortSignal
Produce an AbortSignal bound to this controller. Call
multiple times to attach the same abort semantics to
independent listeners.
Sourcepub fn abort(&self)
pub fn abort(&self)
Fire the abort. Every listener whose signal was spawned from this controller will be skipped + removed on the next dispatch visit. Idempotent — calling twice has no additional effect.
Sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
Has the signal been aborted?
Trait Implementations§
Source§impl Clone for AbortController
impl Clone for AbortController
Source§impl Debug for AbortController
impl Debug for AbortController
Auto Trait Implementations§
impl !RefUnwindSafe for AbortController
impl !Send for AbortController
impl !Sync for AbortController
impl !UnwindSafe for AbortController
impl Freeze for AbortController
impl Unpin for AbortController
impl UnsafeUnpin for AbortController
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