pub struct JoinHandle<T> { /* private fields */ }
Expand description
Handle to join or cancel associated task.
Implementations§
Source§impl<T> JoinHandle<T>
impl<T> JoinHandle<T>
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels associated task with this handle.
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 attach(self) -> TaskHandle<T> ⓘ
pub fn attach(self) -> TaskHandle<T> ⓘ
Attaches to associated task to gain cancel on Drop permission.
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 JoinHandle<T>
impl<T> Drop for JoinHandle<T>
Source§impl<T> Future for JoinHandle<T>
impl<T> Future for JoinHandle<T>
Auto Trait Implementations§
impl<T> Freeze for JoinHandle<T>
impl<T> RefUnwindSafe for JoinHandle<T>
impl<T> Send for JoinHandle<T>where
T: Send,
impl<T> Sync for JoinHandle<T>where
T: Send,
impl<T> Unpin for JoinHandle<T>
impl<T> UnwindSafe for JoinHandle<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