[][src]Enum futures_util::future::MaybeDone

pub enum MaybeDone<Fut: Future> {
    Future(Fut),
    Done(Fut::Output),
    Gone,
}

A future that may have completed.

This is created by the maybe_done() function.

Variants

A not-yet-completed future

The output of the completed future

The empty variant after the result of a MaybeDone has been taken using the take_output method.

Methods

impl<Fut: Future> MaybeDone<Fut>
[src]

Returns an Option containing a mutable reference to the output of the future. The output of this method will be Some if and only if the inner future has been completed and take_output has not yet been called.

Attempt to take the output of a MaybeDone without driving it towards completion.

Trait Implementations

impl<Fut: Debug + Future> Debug for MaybeDone<Fut> where
    Fut::Output: Debug
[src]

Formats the value using the given formatter. Read more

impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut>
[src]

impl<Fut: Future> Future for MaybeDone<Fut>
[src]

🔬 This is a nightly-only experimental API. (futures_api)

futures in libcore are unstable

The result of the Future.

🔬 This is a nightly-only experimental API. (futures_api)

futures in libcore are unstable

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations

impl<Fut> Send for MaybeDone<Fut> where
    Fut: Send,
    <Fut as Future>::Output: Send

impl<Fut> Sync for MaybeDone<Fut> where
    Fut: Sync,
    <Fut as Future>::Output: Sync