[][src]Struct pasts::Task

pub struct Task<'a, F, O> where
    F: Future<Output = O>, 
{ /* fields omitted */ }

A task that is either working or has completed.

Methods

impl<'a, F, O> Task<'a, F, O> where
    F: Future<Output = O>, 
[src]

pub fn set(&mut self, future: F)[src]

Set a new future for this task.

pub fn poll(&mut self, cx: &mut Context) -> Poll<O>[src]

Poll the future associated with this task if it hasn't completed.

pub fn is_wait(&self) -> bool[src]

Return true if still have to wait for future.

pub fn is_done(&self) -> bool[src]

Return true if future has completed.

Auto Trait Implementations

impl<'a, F, O> RefUnwindSafe for Task<'a, F, O> where
    F: RefUnwindSafe

impl<'a, F, O> Send for Task<'a, F, O> where
    F: Send

impl<'a, F, O> Sync for Task<'a, F, O> where
    F: Sync

impl<'a, F, O> Unpin for Task<'a, F, O>

impl<'a, F, O> !UnwindSafe for Task<'a, F, O>

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.