pollable_map/futures/
optional.rs

1use crate::optional::Optional;
2
3/// A reusable future that is the equivalent to an `Option`.
4///
5/// By default, this future will be empty, which would return  [`Poll::Pending`] when polled,
6/// but if a [`Future`] is supplied either upon construction via [`OptionalFuture::new`] or
7/// is set via [`OptionalFuture::replace`], the future would then be polled once [`OptionalFuture`]
8/// is polled. Once the future is polled to completion, the results will be returned, with
9/// [`OptionalFuture`] being empty.
10#[deprecated(note = "Use Optional instead")]
11pub type OptionalFuture<F> = Optional<F>;