pub struct AbortHandle { /* private fields */ }Available on Linux, or Windows, or AArch64 and macOS only.
Expand description
Cloneable handle that can abort a queued task without joining it.
Obtained from JoinHandle::abort_handle. Like the runtime’s futures, this
handle is !Send and only valid on the runtime thread that created the
task. This differs from Tokio’s Send abort handles: runite tasks are local
and the handle is backed by Rc, so abort requests cannot be sent directly
across threads. From another thread, use ThreadHandle::queue_macrotask to
schedule a closure on the owning runtime thread and abort from there.
Implementations§
Source§impl AbortHandle
impl AbortHandle
Sourcepub fn abort(&self)
pub fn abort(&self)
Aborts the associated task. See JoinHandle::abort.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true once the associated task has completed or been aborted.
Trait Implementations§
Source§impl Clone for AbortHandle
impl Clone for AbortHandle
Source§fn clone(&self) -> AbortHandle
fn clone(&self) -> AbortHandle
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for AbortHandle
impl !Send for AbortHandle
impl !Sync for AbortHandle
impl !UnwindSafe for AbortHandle
impl Freeze for AbortHandle
impl Unpin for AbortHandle
impl UnsafeUnpin for AbortHandle
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