#future #async #resolve #valid #wrapped #handy #options

optional-future

Allows an Option<Future> to be used as a Future. This is handy for select! uses where one of the select options is only sometimes a valid future.

1 unstable release

0.1.0 Jul 1, 2024

#10 in #wrapped

MIT license

6KB
95 lines

Crates.io Documentation

optional-future is a library that allows a future that is only sometimes valid to be used in a select context. When it is None it will always be pending and thus never resolve, but when it is Some then then it will resolve when the inner future resolves.

Usage

Add this to your Cargo.toml:

[dependencies]
optional-future = "0.1"

License

Licensed under the MIT License.

Dependencies

~72KB