Enum futures_util::future::TryMaybeDone
source · [−]Expand description
A future that may have completed with an error.
This is created by the try_maybe_done()
function.
Variants
Future(Fut)
A not-yet-completed future
Done(Fut::Ok)
The output of the completed future
Gone
The empty variant after the result of a TryMaybeDone
has been
taken using the take_output
method,
or if the future returned an error.
Implementations
sourceimpl<Fut: TryFuture> TryMaybeDone<Fut>
impl<Fut: TryFuture> TryMaybeDone<Fut>
sourcepub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Ok>
pub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Ok>
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 completed successfully and take_output
has not yet been called.
sourcepub fn take_output(self: Pin<&mut Self>) -> Option<Fut::Ok>
pub fn take_output(self: Pin<&mut Self>) -> Option<Fut::Ok>
Attempt to take the output of a TryMaybeDone
without driving it
towards completion.
Trait Implementations
sourceimpl<Fut: Debug + TryFuture> Debug for TryMaybeDone<Fut>where
Fut::Ok: Debug,
impl<Fut: Debug + TryFuture> Debug for TryMaybeDone<Fut>where
Fut::Ok: Debug,
sourceimpl<Fut: TryFuture> FusedFuture for TryMaybeDone<Fut>
impl<Fut: TryFuture> FusedFuture for TryMaybeDone<Fut>
sourcefn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true
if the underlying future should no longer be polled.sourceimpl<Fut: TryFuture> Future for TryMaybeDone<Fut>
impl<Fut: TryFuture> Future for TryMaybeDone<Fut>
impl<Fut: TryFuture + Unpin> Unpin for TryMaybeDone<Fut>
Auto Trait Implementations
impl<Fut> RefUnwindSafe for TryMaybeDone<Fut>where
Fut: RefUnwindSafe,
<Fut as TryFuture>::Ok: RefUnwindSafe,
impl<Fut> Send for TryMaybeDone<Fut>where
Fut: Send,
<Fut as TryFuture>::Ok: Send,
impl<Fut> Sync for TryMaybeDone<Fut>where
Fut: Sync,
<Fut as TryFuture>::Ok: Sync,
impl<Fut> UnwindSafe for TryMaybeDone<Fut>where
Fut: UnwindSafe,
<Fut as TryFuture>::Ok: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
type Output = <F as Future>::Output
type Output = <F as Future>::Output
The output that the future will produce on completion.
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more