Enum MaybeDone

enum MaybeDone<Fut: Future>

A future that may have completed.

This is created by the [maybe_done()] function.

Variants

Future(Fut)

A not-yet-completed future

Done(<Fut as >::Output)

The output of the completed future

Gone

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

Implementations

impl<Fut: Future> MaybeDone<Fut>

fn output_mut(self: Pin<&mut Self>) -> Option<&mut <Fut as >::Output>

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.

fn take_output(self: Pin<&mut Self>) -> Option<<Fut as >::Output>

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

impl<F> IntoFuture for MaybeDone<Fut>

fn into_future(self: Self) -> <F as IntoFuture>::IntoFuture

impl<Fut> Freeze for MaybeDone<Fut>

impl<Fut> RefUnwindSafe for MaybeDone<Fut>

impl<Fut> Send for MaybeDone<Fut>

impl<Fut> Sync for MaybeDone<Fut>

impl<Fut> UnsafeUnpin for MaybeDone<Fut>

impl<Fut> UnwindSafe for MaybeDone<Fut>

impl<Fut: $crate::fmt::Debug + Future> Debug for MaybeDone<Fut>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut>

impl<Fut: Future> FusedFuture for MaybeDone<Fut>

fn is_terminated(self: &Self) -> bool

impl<Fut: Future> Future for MaybeDone<Fut>

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<<Self as >::Output>

impl<T> Any for MaybeDone<Fut>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for MaybeDone<Fut>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for MaybeDone<Fut>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for MaybeDone<Fut>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FutureExt for MaybeDone<Fut>

impl<T, U> Into for MaybeDone<Fut>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for MaybeDone<Fut>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for MaybeDone<Fut>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>