Module future

Module future 

Available on crate feature future only.
Expand description

Async future utilities.

This module re-exports commonly used future traits and types from the core library and the futures crate. It also provides combinator macros (join!, select!, try_join!) from the tokio crate.

Unlike hbrt::task, this module provides pure composition without relying on an executor.

Macros§

join
Waits on multiple concurrent branches, returning when all branches complete.
select
Waits on multiple concurrent branches, returning when the first branch completes, cancelling the remaining branches.
try_join
Waits on multiple concurrent branches, returning when all branches complete with Ok(_) or on the first Err(_).

Structs§

OptionFuture
A future representing a value which may or may not be present.
Pending
Creates a future which never resolves, representing a computation that never finishes.
PollFn
A Future that wraps a function returning Poll.
Ready
A future that is immediately ready with a value.
ReusableBoxFuture
A reusable Pin<Box<dyn Future<Output = T> + Send + 'a>>.

Traits§

Future
A future represents an asynchronous computation, commonly obtained by use of async.
FutureExt
An extension trait for Futures that provides a variety of convenient adapters.
IntoFuture
Conversion into a Future.
TryFuture
A convenience for futures that return Result values that includes a variety of adapters tailored to such futures.
TryFutureExt
Adapters specific to Result-returning futures

Functions§

pending
Creates a future which never resolves, representing a computation that never finishes.
poll_fn
Creates a future that wraps a function returning Poll.
ready
Creates a future that is immediately ready with a value.