pub struct JoinHandle<T>(/* private fields */);
Expand description
The return value of the spawn_local()
function
Can be used to abort the future, or to get the value from a different thread with .await
This trait implements future. Polling it after it finished or aborted may result in a panic.
Implementations§
Source§impl<T> JoinHandle<T>
impl<T> JoinHandle<T>
Sourcepub fn abort(self)
pub fn abort(self)
If the future hasn’t completed yet, this will make the event loop stop polling the corresponding future and it will be dropped
Once this handle has been aborted, it can no longer be polled
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Checks if the task associated with this JoinHandle
has finished.
Trait Implementations§
Source§impl<T> Future for JoinHandle<T>
impl<T> Future for JoinHandle<T>
impl<T: Send> Send for JoinHandle<T>
Auto Trait Implementations§
impl<T> Freeze for JoinHandle<T>
impl<T> !RefUnwindSafe for JoinHandle<T>
impl<T> Sync for JoinHandle<T>
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