How it works...
Futures (often called promises) are typically fully integrated into the language and come with a built-in runtime. In Rust, the team chose a more ambitious approach and left the runtime open for the community to implement (for now). Right now the two projects Tokio and Romio (https://github.com/withoutboats/romio) and juliex (https://github.com/withoutboats/juliex) have the most sophisticated support for these futures. With the recent addition of async/await in the Rust syntax in the 2018 edition, it's only a matter of time until the various implementations mature.
After setting up the dependencies in step 1, step 2 shows that we don't have to enable the async and await macros/syntax to use them in the code—this was a requirement ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access