Crate futures_util
source ยทExpand description
Combinators and utilities for working with Future
s, Stream
s, Sink
s,
and the AsyncRead
and AsyncWrite
traits.
Re-exportsยง
pub use crate::future::Future;
pub use crate::future::FutureExt;
pub use crate::future::TryFuture;
pub use crate::future::TryFutureExt;
pub use crate::stream::Stream;
pub use crate::stream::StreamExt;
pub use crate::stream::TryStream;
pub use crate::stream::TryStreamExt;
pub use crate::sink::Sink;
pub use crate::sink::SinkExt;
pub use crate::io::AsyncBufRead;
pub use crate::io::AsyncBufReadExt;
pub use crate::io::AsyncRead;
pub use crate::io::AsyncReadExt;
pub use crate::io::AsyncSeek;
pub use crate::io::AsyncSeekExt;
pub use crate::io::AsyncWrite;
pub use crate::io::AsyncWriteExt;
Modulesยง
- abortable ๐
- async_await ๐Await
- fns ๐
- Asynchronous values.
- Asynchronous I/O.
- Futures-powered synchronization primitives.
- This module contains the
Never
type. - Asynchronous sinks.
- Asynchronous streams.
- Tools for working with tasks.
- unfold_state ๐
Macrosยง
- delegate_all ๐
- delegate_async_read ๐
- delegate_async_write ๐
- delegate_future ๐
- delegate_sink ๐
- delegate_stream ๐
- Polls multiple futures simultaneously, returning a tuple of all results once complete.
- 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
. - 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
. - Polls multiple futures simultaneously, resolving to a
Result
containing either a tuple of the successful outputs or an error.