[−][src]Struct async_task::JoinHandle
A handle that awaits the result of a task.
This type is a future that resolves to an Option<R>
where:
None
indicates the task has panicked or was cancelled.Some(result)
indicates the task has completed withresult
of typeR
.
Methods
impl<R, T> JoinHandle<R, T>
[src]
pub fn cancel(&self)
[src]
Cancels the task.
If the task has already completed, calling this method will have no effect.
When a task is cancelled, its future will not be polled again.
pub fn tag(&self) -> &T
[src]
Returns a reference to the tag stored inside the task.
pub fn waker(&self) -> Waker
[src]
Returns a waker associated with the task.
Trait Implementations
impl<R, T> Debug for JoinHandle<R, T>
[src]
impl<R, T> Drop for JoinHandle<R, T>
[src]
impl<R, T> Future for JoinHandle<R, T>
[src]
type Output = Option<R>
The type of value produced on completion.
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output>
[src]
impl<R: Send, T> Send for JoinHandle<R, T>
[src]
impl<R, T> Sync for JoinHandle<R, T>
[src]
impl<R, T> Unpin for JoinHandle<R, T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,