Module futures_util::future
source · Expand description
Asynchronous values.
This module contains:
- The
Future
trait. - The
FutureExt
andTryFutureExt
trait, which provides adapters for chaining and composing futures. - Top-level future combinators like
lazy
which creates a future from a closure that defines its return value, andready
, which constructs a future with an immediate defined value.
Re-exports§
pub use core::future::Future;
Structs§
- Future for the
and_then
method. - Future for the
err_into
method. - Future for the
flatten
method. - Sink for the
flatten_sink
method. - Stream for the
flatten_stream
method. - Future for the
fuse
method. - A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + Send + 'a>
. - Future for the
inspect
method. - Future for the
inspect_err
method. - Future for the
inspect_ok
method. - Future for the
into_future
method. - Stream for the
into_stream
method. - Future for the
join
function. - Future for the
join3
function. - Future for the
join4
function. - Future for the
join5
function. - Future for the
lazy
function. - A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + 'a>
. - Future for the
map
method. - Future for the
map_err
method. - Future for the
map_into
combinator. - Future for the
map_ok
method. - Future for the
map_ok_or_else
method. - Future for the
never_error
combinator. - Future for the
ok_into
method. - A future representing a value which may or may not be present.
- Future for the
or_else
method. - Future for the
pending()
function. - Future for the
poll_fn
function. - Future for the
poll_immediate
function. - Future for the
ready
function. - Future for the
select()
function. - Future for the
then
method. - Future for the
try_flatten
method. - Future for the
try_flatten_stream
method. - Future for the
try_join
function. - Future for the
try_join3
function. - Future for the
try_join4
function. - Future for the
try_join5
function. - Future for the
try_select()
function. - Future for the
unit_error
combinator. - Future for the
unwrap_or_else
method.
Enums§
- Combines two different futures, streams, or sinks having the same associated types into a single type.
- A future that may have completed.
- A future that may have completed with an error.
Traits§
- A future which tracks whether or not the underlying future should no longer be polled.
- An extension trait for
Future
s that provides a variety of convenient adapters. - A convenience for futures that return
Result
values that includes a variety of adapters tailored to such futures. - Adapters specific to
Result
-returning futures - A custom implementation of a future trait object for
FutureObj
, providing a vtable with drop support.
Functions§
- Create a future that is immediately ready with an error value.
- Joins the result of two futures, waiting for them both to complete.
- Same as
join
, but with more futures. - Same as
join
, but with more futures. - Same as
join
, but with more futures. - Creates a new future that allows delayed execution of a closure.
- Wraps a future into a
MaybeDone
- Create a future that is immediately ready with a success value.
- Creates a future which never resolves, representing a computation that never finishes.
- Creates a new future wrapping around a function returning
Poll
. - Creates a future that is immediately ready with an Option of a value. Specifically this means that poll always returns Poll::Ready.
- Creates a future that is immediately ready with a value.
- Waits for either one of two differently-typed futures to complete.
- Joins the result of two futures, waiting for them both to complete or for one to produce an error.
- Same as
try_join
, but with more futures. - Same as
try_join
, but with more futures. - Same as
try_join
, but with more futures. - Wraps a future into a
TryMaybeDone
- Waits for either one of two differently-typed futures to complete.