Struct TaskHandle
pub struct TaskHandle { /* private fields */ }Expand description
Handle for an active background task.
This handle provides introspection into the current state of the task, as well as providing a way to cancel it.
The associated task will not be canceled if this handle is dropped.
Implementations§
§impl TaskHandle
impl TaskHandle
pub fn cancel(self)
pub fn cancel(self)
Cancels the task if it is still pending and does nothing if it is already completed.
pub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Synchronously checks if the task is still pending or has already completed.