[][src]Struct async_task::JoinHandle

pub struct JoinHandle<R, T> { /* fields omitted */ }

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 with result of type R.

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.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.