A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
26.59k
stars
2.45k
forks
source link
tokio::time::timeout should support std::future::IntoFuture #6665
Closed
alexheretic closed 2 months ago
Tokio APIs don't currently support
std::future::IntoFuture
. In particulartokio::time::timeout
&timeout_at
.Example: timeout
So currently the future must be explicitly converted here to use
timeout
.Solution: Support
IntoFuture
If we updated the timeout method to:
The original example would work without the
.into_future()
explicit call.MSRV
Note: This requires bumping the msrv to 1.64 as this version stabilised IntoFuture.