Skip to main content

maybe

Function maybe 

pub async fn maybe<F>(future: Option<F>) -> <F as Future>::Output
where F: Future,
Expand description

Await future if there is one, else stay pending forever.

Unlike future::OptionFuture, which resolves to None, this suits a select! branch that must never fire while its future is absent.