Struct futures_util::future::OptionFuture [−][src]
#[must_use = "futures do nothing unless you `.await` or poll them"]pub struct OptionFuture<F> { /* fields omitted */ }
A future representing a value which may or may not be present.
Created by the From
implementation for Option
.
Examples
use futures::future::OptionFuture; let mut a: OptionFuture<_> = Some(async { 123 }).into(); assert_eq!(a.await, Some(123)); a = None.into(); assert_eq!(a.await, None);
Trait Implementations
impl<F: Clone> Clone for OptionFuture<F>
[src]
impl<F: Clone> Clone for OptionFuture<F>
[src]fn clone(&self) -> OptionFuture<F>ⓘNotable traits for OptionFuture<F>
impl<F: Future> Future for OptionFuture<F> type Output = Option<F::Output>;
[src]
Notable traits for OptionFuture<F>
impl<F: Future> Future for OptionFuture<F> type Output = Option<F::Output>;
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: FusedFuture> FusedFuture for OptionFuture<F>
[src]
impl<F: FusedFuture> FusedFuture for OptionFuture<F>
[src]fn is_terminated(&self) -> bool
[src]
impl<F: Future> Future for OptionFuture<F>
[src]
impl<F: Future> Future for OptionFuture<F>
[src]impl<'__pin, F> Unpin for OptionFuture<F> where
__Origin<'__pin, F>: Unpin,
[src]
__Origin<'__pin, F>: Unpin,
Auto Trait Implementations
impl<F> RefUnwindSafe for OptionFuture<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for OptionFuture<F> where
F: Send,
F: Send,
impl<F> Sync for OptionFuture<F> where
F: Sync,
F: Sync,
impl<F> UnwindSafe for OptionFuture<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<F> IntoFuture for F where
F: Future,
[src]
impl<F> IntoFuture for F where
F: Future,
[src]type Output = <F as Future>::Output
🔬 This is a nightly-only experimental API. (
into_future
)The output that the future will produce on completion.
type Future = F
🔬 This is a nightly-only experimental API. (
into_future
)Which kind of future are we turning this into?