Introduces select!
, join!
, and try_join!
macros for waiting on multiple async operations concurrently from the same task. These macros are implemented primarily as declarative macros, which works around the recursion limit issue. The select!
macro works with any type that implements Future
and does not require special FusedFuture
traits.
Fixes
- docs: misc fixes and tweaks (#2155, #2103, #2027, #2167, #2175).
- macros: handle generics in
#[tokio::main]
method (#2177). - sync:
broadcast
potential lost notifications (#2135). - rt: improve "no runtime" panic messages (#2145).
Added
- optional support for using
parking_lot
internally (#2164). - fs:
fs::copy
, an async version ofstd::fs::copy
(#2079). - macros:
select!
waits for the first branch to complete (#2152). - macros:
join!
waits for all branches to complete (#2158). - macros:
try_join!
waits for all branches to complete or the first error (#2169). - macros:
pin!
pins a value to the stack (#2163). - net:
ReadHalf::poll()
andReadHalf::poll_peak
(#2151) - stream:
StreamExt::timeout()
sets a per-item max duration (#2149). - stream:
StreamExt::fold()
applies a function, producing a single value. (#2122). - sync: impl
Eq
,PartialEq
foroneshot::RecvError
(#2168). - task: methods for inspecting the
JoinError
cause (#2051).