[][src]Struct yaar::task::FutureTask

pub struct FutureTask<F: Future> {
    pub task: Task,
    // some fields omitted
}

A combination of a task and a given future which implements Task based waking and polling.

For convenience purposes in regards to the executors, the task also stores and caches the output of the future.

Fields

task: Task

Methods

impl<F: Future> FutureTask<F>[src]

pub fn new(priority: Priority, future: F) -> Self[src]

Create a new future + task wrapper.

pub fn into_output(self) -> Option<F::Output>[src]

Convert the FutureTask into its underlying output value.

pub fn resume(&mut self) -> Poll<&F::Output>[src]

Resume the future wrapped task, returning the resulting output.

This effectively calls Future::poll() with the waker and context setup to resume the future using the task as a reference if the futures output is not already polled() and stored.

Trait Implementations

impl<F: Future> Future for FutureTask<F>[src]

type Output = NonNull<F::Output>

The type of value produced on completion.

fn poll(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Self::Output>[src]

Polls the FutureTask for the result or returns the cached output as a NonNull pointer. This returns a pointer instead of an immutable reference since rust doesnt allow references for type annotations for Future::Output.

impl<F: Future> Unpin for FutureTask<F>[src]

Auto Trait Implementations

impl<F> Send for FutureTask<F> where
    F: Send,
    <F as Future>::Output: Send

impl<F> Sync for FutureTask<F> where
    F: Sync,
    <F as Future>::Output: Sync

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.