Module completion::future[][src]

Utilities for the CompletionFuture trait.

Unlike the futures crate, all the joining futures (functions like zip, race, zip_all, etc) in this module adopt an efficient polling strategy, where they only poll the futures that issued wakeups, instead of polling every single future whenever just one of them issues a wakeup. This reduces their complexity from O(n^2) to O(n), making them suitable for large numbers of futures.

Re-exports

pub use core::future::pending;
pub use core::future::ready;
pub use core::future::Pending;
pub use core::future::Ready;
pub use completion_core::CompletionFuture;

Structs

CatchUnwindstd

Future for CompletionFutureExt::catch_unwind.

NowOrNever

Future for CompletionFutureExt::now_or_never.

Racestd

Future for race.

RaceAllstd

Future for race_all.

RaceOkstd

Future for race_ok.

RaceOkAllstd

Future for race_ok_all. If all the futures fail, this returns a RaceOkAllErrors.

RaceOkAllErrorsstd

An iterator over the errors of the futures in a RaceOkAll.

TryZipstd

Future for try_zip.

TryZipAllstd

Future for try_zip_all. On success, this outputs a TryZipAllOutput.

TryZipAllOutputstd

An iterator over the successful outputs of futures in a TryZipAll.

Zipstd

Future for zip.

ZipAllstd

Future for zip_all. This outputs a ZipAllOutput.

ZipAllOutputstd

An iterator over the outputs of futures in a ZipAll.

Traits

CompletionFutureExt

Extension trait for CompletionFuture.

FutureExt

Extension trait for converting Futures to CompletionFutures.

Functions

block_onstd

Blocks the current thread on a completion future.

racestd

Wait for the first future in a tuple to complete.

race_allstd

Wait for the first future in an iterator to complete.

race_okstd

Wait for the first future in a tuple to successfully complete.

race_ok_allstd

Wait for the first future in an iterator to successfully complete.

try_zipstd

Wait for all the futures in a tuple to successfully complete or one to return an error.

try_zip_allstd

Wait for all the futures in an iterator to successfully complete or one to return an error.

zipstd

Wait for all the futures in a tuple to complete.

zip_allstd

Wait for all the futures in an iterator to complete.

Type Definitions

BoxCompletionFuturealloc

A type-erased completion future.

LocalBoxCompletionFuturealloc

A type-erased completion future that cannot be send across threads.