futures

Module future

Source
Expand description

Asynchronous values.

This module contains:

  • The Future trait.

  • The FutureExt 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, and result, which constructs a future with an immediate defined value.

Structs§

  • Future for the and_then combinator, chaining a computation onto the end of another future which completes successfully.
  • Future for the catch_unwind combinator.
  • A future which is never resolved.
  • Future for the err_into combinator, changing the error type of a future.
  • Future for the flatten combinator.
  • Future for the flatten_stream combinator, flattening a future-of-a-stream to get just the result of the final stream as a stream.
  • A future which “fuses” a future once it’s been resolved.
  • A future representing a value which may or may not be present.
  • A future representing a value that is immediately ready.
  • Do something with the item of a future, passing it on.
  • A type which converts a Future into a Stream containing a single element.
  • Future for the join combinator, waiting for two futures to complete.
  • Future for the join3 combinator, waiting for three futures to complete.
  • Future for the join4 combinator, waiting for four futures to complete.
  • Future for the join5 combinator, waiting for five futures to complete.
  • A future which takes a list of futures and resolves with a vector of the completed values.
  • A future which defers creation of the actual future until the future is polled.
  • A future implementing a tail-recursive loop.
  • Future for the map combinator, changing the type of a future.
  • Future for the map_err combinator, changing the error type of a future.
  • Future for the or_else combinator, chaining a computation onto the end of a future which fails with an error.
  • A future which adapts a function returning Poll.
  • Future for the select combinator, waiting for one of two differently-typed futures to complete.
  • Future for the select_all combinator, waiting for one of any of a list of futures to complete.
  • Future for the select_ok combinator, waiting for one of any of a list of futures to successfully complete. Unlike select_all, this future ignores all but the last error, if there are any.
  • A future that is cloneable and can be polled in multiple threads. Use Future::shared() method to convert any future into a Shared future.
  • A wrapped error of the original future that is cloneable and implements Deref for ease of use.
  • A wrapped item of the original future that is cloneable and implements Deref for ease of use.
  • Future for the then combinator, chaining computations on the end of another future regardless of its outcome.

Enums§

  • The enum Either with variants Left and Right is a general purpose sum type with two cases.
  • An enum describing whether to break or continue a loop_fn loop.

Traits§

  • A future represents an asychronous computation that may fail.
  • An extension trait for Futures that provides a variety of convenient combinator functions.
  • Types that can be converted into a future.

Functions§

  • Creates a future which never resolves, representing a computation that never finishes.
  • Creates a new future that will immediately fail with the given error.
  • Creates a future which represents a collection of the results of the futures given.
  • Creates a new future which will eventually be the same as the one created by the closure provided.
  • Creates a new future implementing a tail-recursive loop.
  • Creates a new future that will immediately resolve successfully to the given value.
  • Creates a new future wrapping around a function returning Poll.
  • Creates a new future that will immediate resolve with the given result.
  • 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.