[][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 canceled.
  • 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 canceled, 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]

Auto Trait Implementations

impl<R, T> RefUnwindSafe for JoinHandle<R, T> where
    R: RefUnwindSafe,
    T: RefUnwindSafe

impl<R, T> UnwindSafe for JoinHandle<R, T> where
    R: UnwindSafe,
    T: UnwindSafe

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.