Expand description
Futures
This module contains the Future trait and a number of adaptors for this
trait. See the crate docs, and the docs for Future, for full detail.
Structs§
- AndThen
- Future for the
and_thencombinator, chaining a computation onto the end of another future which completes successfully. - Catch
Unwind - Future for the
catch_unwindcombinator. - Collect
- A future which takes a list of futures and resolves with a vector of the completed values.
- Done
- A future representing a value that is immediately ready.
- Empty
- A future which is never resolved.
- Err
- A future representing a value that is immediately ready.
- Execute
Error - Errors returned from the
Spawn::spawnfunction. - Failed
- A future representing a value that is immediately ready.
- Finished
- A future representing a value that is immediately ready.
- Flatten
- Future for the
flattencombinator, flattening a future-of-a-future to get just the result of the final future. - Flatten
Stream - Future for the
flatten_streamcombinator, flattening a future-of-a-stream to get just the result of the final stream as a stream. - FromErr
- Future for the
from_errcombinator, changing the error type of a future. - Fuse
- A future which “fuses” a future once it’s been resolved.
- Future
Result - A future representing a value that is immediately ready.
- Inspect
- Do something with the item of a future, passing it on.
- Into
Stream - Future that forwards one element from the underlying future (whether it is success of error) and emits EOF after that.
- Join
- Future for the
joincombinator, waiting for two futures to complete. - Join3
- Future for the
join3combinator, waiting for three futures to complete. - Join4
- Future for the
join4combinator, waiting for four futures to complete. - Join5
- Future for the
join5combinator, 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 a callback is scheduled.
- LoopFn
- A future implementing a tail-recursive loop.
- Map
- Future for the
mapcombinator, changing the type of a future. - MapErr
- Future for the
map_errcombinator, changing the error type of a future. - Ok
- A future representing a value that is immediately ready.
- OrElse
- Future for the
or_elsecombinator, chaining a computation onto the end of a future which fails with an error. - PollFn
- A future which adapts a function returning
Poll. - Select
- Future for the
selectcombinator, waiting for one of two futures to complete. - Select2
- Future for the
select2combinator, waiting for one of two differently-typed futures to complete. - Select
All - Future for the
select_allcombinator, waiting for one of any of a list of futures to complete. - Select
Next - Future yielded as the second result in a
Selectfuture. - Select
Ok - Future for the
select_okcombinator, 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 aSharedfuture. - 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
thencombinator, chaining computations on the end of another future regardless of its outcome.
Enums§
- Either
- Combines two different futures yielding the same item and error types into a single type.
- Execute
Error Kind - Kinds of errors that can be returned from the
Execute::spawnfunction. - Loop
- The status of a
loop_fnloop.
Traits§
- Executor
- A trait for types which can spawn fresh futures.
- Future
- Trait for types which are a placeholder of a value that may become available at some later point in time.
- Future
From - Asynchronous conversion from a type
T. - Into
Future - Class of types which can be converted into a future.
Functions§
- collect
- Creates a future which represents a collection of the results of the futures given.
- done
- Creates a new “leaf future” which will resolve with the given result.
- empty
- Creates a future which never resolves, representing a computation that never finishes.
- err
- Creates a “leaf future” from an immediate value of a failed computation.
- failed
- Creates a “leaf future” from an immediate value of a failed computation.
- finished
- Creates a “leaf future” from an immediate value of a finished and successful computation.
- 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.
- ok
- Creates a “leaf future” from an immediate value of a finished and successful computation.
- poll_fn
- Creates a new future wrapping around a function returning
Poll. - result
- Creates a new “leaf future” which will resolve with the given result.
- 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.