Expand description
Futures
This module contains a number of functions for working with Future
s,
including the FutureExt
trait which adds methods to Future
types.
Re-exports§
pub use self::select_all::SelectAllNext;
Structs§
- AndThen
- Future for the
and_then
combinator, chaining a computation onto the end of another future which completes successfully. - Catch
Unwind - Future for the
catch_unwind
combinator. - Empty
- A future which is never resolved.
- ErrInto
- Future for the
err_into
combinator, changing the error type of a future. - Flatten
- Future for the
flatten
combinator. - Flatten
Sink - Future for the
flatten_sink
combinator, flattening a future-of-a-sink to get just the result of the final sink as a sink. - Flatten
Stream - Future for the
flatten_stream
combinator, flattening a future-of-a-stream to get just the result of the final stream as a stream. - Fuse
- A future which “fuses” a future once it’s been resolved.
- Inspect
- Do something with the item of a future, passing it on.
- Inspect
Err - Do something with the error of a future, passing it on.
- Into
Stream - A type which converts a
Future
into aStream
containing a single element. - Join
- Future for the
join
combinator, waiting for two futures to complete. - Join3
- Future for the
join3
combinator, waiting for three futures to complete. - Join4
- Future for the
join4
combinator, waiting for four futures to complete. - Join5
- Future for the
join5
combinator, waiting for five futures to complete. - JoinAll
- A future which takes a list of futures and resolves with a vector of the completed values.
- Lazy
- A future which defers creation of the actual future until the future
is
poll
ed. - LoopFn
- A future implementing a tail-recursive loop.
- Map
- Future for the
map
combinator, changing the type of a future. - MapErr
- Future for the
map_err
combinator, changing the error type of a future. - OrElse
- Future for the
or_else
combinator, chaining a computation onto the end of a future which fails with an error. - PollFn
- A future which adapts a function returning
Poll
. - Recover
- Future for the
recover
combinator, handling errors by converting them into anItem
, compatible with any error type of the caller’s choosing. - Select
- Future for the
select
combinator, waiting for one of two differently-typed futures to complete. - Select
All - Future for the
select_all
combinator, waiting for one of any of a list of futures to complete. - Select
Ok - Future for the
select_ok
combinator, waiting for one of any of a list of futures to successfully complete. Unlikeselect_all
, this future ignores all but the last error, if there are any. - Shared
- A future that is cloneable and can be polled in multiple threads.
Use
Future::shared()
method to convert any future into aShared
future. - Shared
Error - A wrapped error of the original future that is cloneable and implements Deref for ease of use.
- Shared
Item - A wrapped item of the original future that is cloneable and implements Deref for ease of use.
- Then
- Future for the
then
combinator, chaining computations on the end of another future regardless of its outcome. - With
Executor - Future for the
with_executor
combinator, assigning an executor to be used when spawning other futures.
Enums§
- Either
- The enum
Either
with variantsLeft
andRight
is a general purpose sum type with two cases. - Loop
- An enum describing whether to
break
orcontinue
aloop_fn
loop.
Traits§
- Future
Ext - An extension trait for
Future
s that provides a variety of convenient combinator functions.
Functions§
- empty
- Creates a future which never resolves, representing a computation that never finishes.
- join_
all - Creates a future which represents a collection of the results of the futures given.
- lazy
- Creates a new future which will eventually be the same as the one created by the closure provided.
- loop_fn
- Creates a new future implementing a tail-recursive loop.
- poll_fn
- Creates a new future wrapping around a function returning
Poll
. - 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.