pub struct TaskHandle { /* private fields */ }Expand description
Non-owning, cloneable control handle for a local task. It can be used from any thread; dropping it does not affect the task.
Implementations§
Source§impl TaskHandle
impl TaskHandle
Sourcepub fn abort(&self)
pub fn abort(&self)
Stop the task at its next suspension point. The future is dropped on its shard’s thread; a running synchronous section is never interrupted.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the task completed, panicked, or was dropped after an abort. An aborted task counts as finished once its shard has dropped it.
Trait Implementations§
Source§impl Clone for TaskHandle
impl Clone for TaskHandle
Auto Trait Implementations§
impl !RefUnwindSafe for TaskHandle
impl !UnwindSafe for TaskHandle
impl Freeze for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl UnsafeUnpin for TaskHandle
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