Module future
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.
Structs
-
AbortHandle
A handle to an
Abortabletask. -
AbortRegistration
A registration handle for an
Abortabletask. Values of this type can be acquired fromAbortHandle::newand are used in calls toAbortable::new. -
Abortable
A future/stream which can be remotely short-circuited using an
AbortHandle. -
Aborted
Indicator that the
Abortabletask was aborted. -
AlwaysReady
Future for the
always_readyfunction. -
AndThen
Future for the
and_thenmethod. -
CatchUnwind
Future for the
catch_unwindmethod. -
ErrInto
Future for the
err_intomethod. -
Flatten
Future for the
flattenmethod. -
FlattenSink
Sink for the
flatten_sinkmethod. -
FlattenStream
Stream for the
flatten_streammethod. -
Fuse
Future for the
fusemethod. - FutureObj
-
Inspect
Future for the
inspectmethod. -
InspectErr
Future for the
inspect_errmethod. -
InspectOk
Future for the
inspect_okmethod. -
IntoFuture
Future for the
into_futuremethod. -
IntoStream
Stream for the
into_streammethod. -
Join
Future for the
joinfunction. -
Join3
Future for the
join3function. -
Join4
Future for the
join4function. -
Join5
Future for the
join5function. -
JoinAll
Future for the
join_allfunction. -
Lazy
Future for the
lazyfunction. - LocalFutureObj
-
Map
Future for the
mapmethod. -
MapErr
Future for the
map_errmethod. -
MapInto
Future for the
map_intocombinator. -
MapOk
Future for the
map_okmethod. -
MapOkOrElse
Future for the
map_ok_or_elsemethod. -
NeverError
Future for the
never_errorcombinator. -
OkInto
Future for the
ok_intomethod. - OptionFuture A future representing a value which may or may not be present.
-
OrElse
Future for the
or_elsemethod. -
Pending
Future for the [
pending()] function. -
PollFn
Future for the
poll_fnfunction. -
PollImmediate
Future for the
poll_immediatefunction. -
Ready
Future for the
readyfunction. -
Remote
A future which sends its output to the corresponding
RemoteHandle. Created byremote_handle. -
RemoteHandle
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. -
Select
Future for the [
select()] function. -
SelectAll
Future for the
select_allfunction. -
SelectOk
Future for the
select_okfunction. -
Shared
Future for the
sharedmethod. -
Then
Future for the
thenmethod. -
TryFlatten
Future for the
try_flattenmethod. -
TryFlattenStream
Future for the
try_flatten_streammethod. -
TryJoin
Future for the
try_joinfunction. -
TryJoin3
Future for the
try_join3function. -
TryJoin4
Future for the
try_join4function. -
TryJoin5
Future for the
try_join5function. -
TryJoinAll
Future for the
try_join_allfunction. -
TrySelect
Future for the [
try_select()] function. -
UnitError
Future for the
unit_errorcombinator. -
UnwrapOrElse
Future for the
unwrap_or_elsemethod. -
WeakShared
A weak reference to a
Sharedthat can be upgraded much like anArc.
Enums
- Either Combines two different futures, streams, or sinks having the same associated types into a single type.
- MaybeDone A future that may have completed.
- TryMaybeDone A future that may have completed with an error.
Traits
- FusedFuture
- Future
-
FutureExt
An extension trait for
Futures that provides a variety of convenient adapters. - TryFuture
-
TryFutureExt
Adapters specific to
Result-returning futures - UnsafeFutureObj
Functions
-
abortable
Creates a new
Abortablefuture and anAbortHandlewhich can be used to stop it. - always_ready Creates a future that is always immediately ready with a value.
- err Create a future that is immediately ready with an error value.
- join Joins the result of two futures, waiting for them both to complete.
-
join3
Same as
join, but with more futures. -
join4
Same as
join, but with more futures. -
join5
Same as
join, but with more futures. - join_all Creates a future which represents a collection of the outputs of the futures given.
- lazy Creates a new future that allows delayed execution of a closure.
-
maybe_done
Wraps a future into a
MaybeDone - ok Create a future that is immediately ready with a success value.
- pending Creates a future which never resolves, representing a computation that never finishes.
-
poll_fn
Creates a new future wrapping around a function returning
Poll. - poll_immediate Creates a future that is immediately ready with an Option of a value. Specifically this means that poll always returns Poll::Ready.
- ready Creates a future that is immediately ready with a value.
- select Waits for either one of two differently-typed futures to complete.
- select_all Creates a new future which will select over a list of futures.
- select_ok Creates a new future which will select the first successful future over a list of futures.
- try_join Joins the result of two futures, waiting for them both to complete or for one to produce an error.
-
try_join3
Same as
try_join, but with more futures. -
try_join4
Same as
try_join, but with more futures. -
try_join5
Same as
try_join, but with more futures. - try_join_all Creates a future which represents either a collection of the results of the futures given or an error.
-
try_maybe_done
Wraps a future into a
TryMaybeDone - try_select Waits for either one of two differently-typed futures to complete.