v1.4.0
This patch adds Future::timeout, providing a method counterpart to the
future::timeout free function. And includes several bug fixes around missing
APIs. Notably we're not shipping our new executor yet, first announced on our
blog.
Examples
use async_std::prelude::*;
use async_std::future;
use std::time::Duration;
let fut = future::pending::<()>(); // This future will never resolve.
let res = fut.timeout(Duration::from_millis(100)).await;
assert!(res.is_err()); // The future timed out, returning an err.Added
- Added
Future::timeoutas "unstable" (#600)
Fixes
- Fixed a doc test and enabled it on CI (#597)
- Fixed a rendering issue with the
streamsubmodule documentation (#621) Write::write_fmt's future is now correctly marked as#[must_use](#628)- Fixed the missing
io::Bytesexport (#633) - Fixed the missing
io::Chainexport (#633) - Fixed the missing
io::Takeexport (#633)