Expand description
Asynchronous values.
This module contains:
- The
Futuretrait. - The
FutureExtandTryFutureExttrait, which provides adapters for chaining and composing futures. - Top-level future combinators like
lazywhich 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§
- A handle to an
Abortabletask. - A registration handle for an
Abortabletask. Values of this type can be acquired fromAbortHandle::newand are used in calls toAbortable::new. - A future/stream which can be remotely short-circuited using an
AbortHandle. - Indicator that the
Abortabletask was aborted. - Future for the
always_readyfunction. - Future for the
and_thenmethod. - Future for the
catch_unwindmethod. - Future for the
err_intomethod. - Future for the
flattenmethod. - Sink for the
flatten_sinkmethod. - Stream for the
flatten_streammethod. - Future for the
fusemethod. - A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + Send + 'a>. - Future for the
inspectmethod. - Future for the
inspect_errmethod. - Future for the
inspect_okmethod. - Future for the
into_futuremethod. - Stream for the
into_streammethod. - Future for the
joinfunction. - Future for the
join3function. - Future for the
join4function. - Future for the
join5function. - Future for the
join_allfunction. - Future for the
lazyfunction. - A custom trait object for polling futures, roughly akin to
Box<dyn Future<Output = T> + 'a>. - Future for the
mapmethod. - Future for the
map_errmethod. - Future for the
map_intocombinator. - Future for the
map_okmethod. - Future for the
map_ok_or_elsemethod. - Future for the
never_errorcombinator. - Future for the
ok_intomethod. - A future representing a value which may or may not be present.
- Future for the
or_elsemethod. - Future for the
pending()function. - Future for the
poll_fnfunction. - Future for the
poll_immediatefunction. - Future for the
readyfunction. - A future which sends its output to the corresponding
RemoteHandle. Created byremote_handle. - The handle to a remote future returned by
remote_handle. When you drop this, the remote future will be woken up to be dropped by the executor. - Future for the
select()function. - Future for the
select_allfunction. - Future for the
select_okfunction. - Future for the
sharedmethod. - Future for the
thenmethod. - Future for the
try_flattenmethod. - Future for the
try_flatten_streammethod. - Future for the
try_joinfunction. - Future for the
try_join3function. - Future for the
try_join4function. - Future for the
try_join5function. - Future for the
try_join_allfunction. - Future for the
try_select()function. - Future for the
unit_errorcombinator. - Future for the
unwrap_or_elsemethod. - A weak reference to a
Sharedthat can be upgraded much like anArc.
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
Futures that provides a variety of convenient adapters. - A convenience for futures that return
Resultvalues 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§
- Creates a new
Abortablefuture and anAbortHandlewhich can be used to stop it. - Creates a future that is always immediately ready with a value.
- 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 future which represents a collection of the outputs of the futures given.
- 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.
- Creates a new future which will select over a list of futures.
- Creates a new future which will select the first successful future over a list of futures.
- 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. - Creates a future which represents either a collection of the results of the futures given or an error.
- Wraps a future into a
TryMaybeDone - Waits for either one of two differently-typed futures to complete.
Type Aliases§
- An owned dynamically typed
Futurefor use in cases where you can’t statically type your result or need to add some indirection. BoxFuture, but without theSendrequirement.