[][src]Module futures_util::future

Futures

This module contains a number of functions for working with Futures, including the FutureExt trait which adds methods to Future types.

Structs

AbortHandle

A handle to a Abortable future.

AbortRegistration

A registration handle for a Abortable future. Values of this type can be acquired from AbortHandle::new and are used in calls to Abortable::new.

Abortable

A future which can be remotely short-circuited using an AbortHandle.

Aborted

Indicator that the Abortable future was aborted.

CatchUnwind

Future for the catch_unwind combinator.

Empty

A future which is never resolved.

Flatten

Future for the flatten combinator.

FlattenStream

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.

IntoStream

A type which converts a Future into a Stream 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.

Lazy

A future which, when polled, invokes a closure and yields its result.

Map

Future for the map combinator, changing the type of a future.

OptionFuture

A future representing a value which may or may not be present.

PollFn

A future which wraps a function returning Poll.

Ready

A future that is immediately ready with a value

Remote

A future which sends its output to the corresponding RemoteHandle. Created by remote_handle.

RemoteHandle

The handle to a remote future returned by remote_handle.

Shared

A future that is cloneable and can be polled in multiple threads. Use Future::shared() method to convert any future into a Shared future.

Then

Future for the then combinator, chaining computations on the end of another future regardless of its outcome.

UnitError

Future for the unit_error combinator, turning a Future into a TryFuture.

Enums

MaybeDone

A future that may have completed.

Traits

FutureExt

An extension trait for Futures that provides a variety of convenient adapters.

Functions

abortable

Creates a new Abortable future and a AbortHandle which can be used to stop it.

empty

Creates a future which never resolves, representing a computation that never finishes.

err

Create a future that is immediately ready with an error value.

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.

poll_fn

Creates a new future wrapping around a function returning Poll.

ready

Create a future that is immediately ready with a value.