Crate tina::futures_util
Expand description
Combinators and utilities for working with Future
s, Stream
s, Sink
s,
and the AsyncRead
and AsyncWrite
traits.
Macros
- Polls multiple futures simultaneously, returning a tuple of all results once complete.
- The
join!
macro. - A macro which yields to the event loop once.
- Pins a value on the stack.
- A macro which returns the result of polling a future once within the current
async
context. - Extracts the successful type of a
Poll<T>
. - 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 beUnpin
and implementFusedFuture
. - 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 beUnpin
and implementFusedFuture
. - The
select_biased!
macro. - The
select!
macro. - Combines several streams, all producing the same
Item
type, into one stream. This is similar toselect_all
but 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
. - The
stream_select!
macro. - Polls multiple futures simultaneously, resolving to a
Result
containing either a tuple of the successful outputs or an error. - The
try_join!
macro.
Traits
- Read bytes asynchronously.
- An extension trait which adds utility methods to
AsyncBufRead
types. - Read bytes asynchronously.
- An extension trait which adds utility methods to
AsyncRead
types. - Seek bytes asynchronously.
- An extension trait which adds utility methods to
AsyncSeek
types. - Write bytes asynchronously.
- An extension trait which adds utility methods to
AsyncWrite
types. - A future represents an asynchronous computation obtained by use of
async
. - An extension trait for
Future
s that provides a variety of convenient adapters. - A
Sink
is a value into which other values can be sent, asynchronously. - An extension trait for
Sink
s that provides a variety of convenient combinator functions. - A stream of values produced asynchronously.
- An extension trait for
Stream
s that provides a variety of convenient combinator functions. - A convenience for futures that return
Result
values that includes a variety of adapters tailored to such futures. - Adapters specific to
Result
-returning futures - A convenience for streams that return
Result
values that includes a variety of adapters tailored to such futures. - Adapters specific to
Result
-returning streams