Enum futures_util::future::MaybeDone
source · [−]Expand description
A future that may have completed.
This is created by the maybe_done()
function.
Variants
Future(Fut)
A not-yet-completed future
Done(Fut::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
sourceimpl<Fut: Future> MaybeDone<Fut>
impl<Fut: Future> MaybeDone<Fut>
sourcepub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output>
pub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::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.
Trait Implementations
sourceimpl<Fut: Future> FusedFuture for MaybeDone<Fut>
impl<Fut: Future> FusedFuture for MaybeDone<Fut>
sourcefn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true
if the underlying future should no longer be polled.impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut>
Auto Trait Implementations
impl<Fut> RefUnwindSafe for MaybeDone<Fut>where
Fut: RefUnwindSafe,
<Fut as Future>::Output: RefUnwindSafe,
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,
impl<Fut> UnwindSafe for MaybeDone<Fut>where
Fut: UnwindSafe,
<Fut as Future>::Output: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
sourcefn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more