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.
Auto Trait Implementations§
impl Freeze for TaskHandle
impl RefUnwindSafe for TaskHandle
impl !Send for TaskHandle
impl !Sync for TaskHandle
impl Unpin for TaskHandle
impl UnwindSafe 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