[−][src]Struct futures::future::OptionFuture
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> Future for OptionFuture<F> where
F: Future,
[src]
F: Future,
type Output = Option<<F as Future>::Output>
The type of value produced on completion.
fn poll(
self: Pin<&mut OptionFuture<F>>,
cx: &mut Context
) -> Poll<<OptionFuture<F> as Future>::Output>
[src]
self: Pin<&mut OptionFuture<F>>,
cx: &mut Context
) -> Poll<<OptionFuture<F> as Future>::Output>
impl<F> FusedFuture for OptionFuture<F> where
F: FusedFuture,
[src]
F: FusedFuture,
fn is_terminated(&self) -> bool
[src]
impl<F> Debug for OptionFuture<F> where
F: Debug,
[src]
F: Debug,
impl<T> From<Option<T>> for OptionFuture<T>
[src]
ⓘImportant traits for OptionFuture<F>fn from(option: Option<T>) -> OptionFuture<T>
[src]
ⓘImportant traits for OptionFuture<F>
impl<F> Clone for OptionFuture<F> where
F: Clone,
[src]
F: Clone,
ⓘImportant traits for OptionFuture<F>fn clone(&self) -> OptionFuture<F>
[src]
ⓘImportant traits for OptionFuture<F>
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<F> Send for OptionFuture<F> where
F: Send,
F: Send,
impl<F> Sync for OptionFuture<F> where
F: Sync,
F: Sync,
impl<F> Unpin for OptionFuture<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for OptionFuture<F> where
F: UnwindSafe,
F: UnwindSafe,
impl<F> RefUnwindSafe for OptionFuture<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ffn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut F
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> FutureExt for T where
T: Future + ?Sized,
[src]
T: Future + ?Sized,
ⓘImportant traits for Map<Fut, F>fn map<U, F>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U,
[src]
ⓘImportant traits for Map<Fut, F>
F: FnOnce(Self::Output) -> U,
ⓘImportant traits for Then<Fut1, Fut2, F>fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
[src]
ⓘImportant traits for Then<Fut1, Fut2, F>
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
ⓘImportant traits for Either<A, B>fn left_future<B>(self) -> Either<Self, B> where
B: Future<Output = Self::Output>,
[src]
ⓘImportant traits for Either<A, B>
B: Future<Output = Self::Output>,
ⓘImportant traits for Either<A, B>fn right_future<A>(self) -> Either<A, Self> where
A: Future<Output = Self::Output>,
[src]
ⓘImportant traits for Either<A, B>
A: Future<Output = Self::Output>,
fn into_stream(self) -> IntoStream<Self>
[src]
ⓘImportant traits for Flatten<Fut>fn flatten(self) -> Flatten<Self> where
Self::Output: Future,
[src]
ⓘImportant traits for Flatten<Fut>
Self::Output: Future,
fn flatten_stream(self) -> FlattenStream<Self> where
Self::Output: Stream,
[src]
Self::Output: Stream,
ⓘImportant traits for Fuse<Fut>fn fuse(self) -> Fuse<Self>
[src]
ⓘImportant traits for Fuse<Fut>
ⓘImportant traits for Inspect<Fut, F>fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output),
[src]
ⓘImportant traits for Inspect<Fut, F>
F: FnOnce(&Self::Output),
ⓘImportant traits for CatchUnwind<Fut>fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[src]
ⓘImportant traits for CatchUnwind<Fut>
Self: UnwindSafe,
ⓘImportant traits for Shared<Fut>fn shared(self) -> Shared<Self> where
Self::Output: Clone,
[src]
ⓘImportant traits for Shared<Fut>
Self::Output: Clone,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
[src]
ⓘImportant traits for Pin<P>fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send>> where
Self: Send + 'a,
[src]
ⓘImportant traits for Pin<P>
Self: Send + 'a,
ⓘImportant traits for Pin<P>fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>> where
Self: 'a,
[src]
ⓘImportant traits for Pin<P>
Self: 'a,
ⓘImportant traits for UnitError<Fut>fn unit_error(self) -> UnitError<Self>
[src]
ⓘImportant traits for UnitError<Fut>
ⓘImportant traits for NeverError<Fut>fn never_error(self) -> NeverError<Self>
[src]
ⓘImportant traits for NeverError<Fut>
fn poll_unpin(&mut self, cx: &mut Context) -> Poll<Self::Output> where
Self: Unpin,
[src]
Self: Unpin,