pub struct TaskHandle<T> { /* private fields */ }
Expand description
An owned permission to cancel task on Drop besides join and cancel on demand.
Implementations§
Source§impl<T> TaskHandle<T>
impl<T> TaskHandle<T>
Sourcepub fn detach(self) -> JoinHandle<T> ⓘ
pub fn detach(self) -> JoinHandle<T> ⓘ
Detaches task from permission to cancel on Drop.
Sourcepub fn cancel(self) -> JoinHandle<T> ⓘ
pub fn cancel(self) -> JoinHandle<T> ⓘ
Cancels owning task.
Cancellation is inherently concurrent with task execution. Currently, there is no guarantee about promptness, the task could even run to complete normally after cancellation.
Sourcepub fn cancel_handle(&self) -> CancelHandle
pub fn cancel_handle(&self) -> CancelHandle
Creates a handle to cancel associated task.
Trait Implementations§
Source§impl<T> Drop for TaskHandle<T>
impl<T> Drop for TaskHandle<T>
Source§impl<T> Future for TaskHandle<T>
impl<T> Future for TaskHandle<T>
Auto Trait Implementations§
impl<T> Freeze for TaskHandle<T>
impl<T> RefUnwindSafe for TaskHandle<T>
impl<T> Send for TaskHandle<T>where
T: Send,
impl<T> Sync for TaskHandle<T>where
T: Send,
impl<T> Unpin for TaskHandle<T>
impl<T> UnwindSafe for TaskHandle<T>
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more