Crate futures_util
Combinators and utilities for working with Futures, Streams, Sinks,
and the AsyncRead and AsyncWrite traits.
Modules
Traits
- AsyncBufRead
-
AsyncBufReadExt
An extension trait which adds utility methods to
AsyncBufReadtypes. - AsyncRead
-
AsyncReadExt
An extension trait which adds utility methods to
AsyncReadtypes. - AsyncSeek
-
AsyncSeekExt
An extension trait which adds utility methods to
AsyncSeektypes. - AsyncWrite
-
AsyncWriteExt
An extension trait which adds utility methods to
AsyncWritetypes. - Future
-
FutureExt
An extension trait for
Futures that provides a variety of convenient adapters. - Sink
-
SinkExt
An extension trait for
Sinks that provides a variety of convenient combinator functions. - Stream
-
StreamExt
An extension trait for
Streams that provides a variety of convenient combinator functions. - TryFuture
-
TryFutureExt
Adapters specific to
Result-returning futures - TryStream
-
TryStreamExt
Adapters specific to
Result-returning streams
Macros
- join Polls multiple futures simultaneously, returning a tuple of all results once complete.
- pending A macro which yields to the event loop once.
- pin_mut
-
poll
A macro which returns the result of polling a future once within the
current
asynccontext. - ready
-
select
Polls multiple futures and streams simultaneously, executing the branch
for the future that finishes first. If multiple futures are ready,
one will be pseudo-randomly selected at runtime. Futures directly
passed to
select!must beUnpinand implementFusedFuture. -
select_biased
Polls multiple futures and streams simultaneously, executing the branch
for the future that finishes first. Unlike [
select!], if multiple futures are ready, one will be selected in order of declaration. Futures directly passed toselect_biased!must beUnpinand implementFusedFuture. -
stream_select
Combines several streams, all producing the same
Itemtype, into one stream. This is similar toselect_allbut does not require the streams to all be the same type. It also keeps the streams inline, and does not requireBox<dyn Stream>s to be allocated. Streams passed to this macro must beUnpin. -
try_join
Polls multiple futures simultaneously, resolving to a
Resultcontaining either a tuple of the successful outputs or an error.