6

Futures in Rust

In Chapter 5, we covered one of the most popular ways of modeling concurrency in a programming language: fibers/green threads. Fibers/green threads are an example of stackful coroutines. The other popular way of modeling asynchronous program flow is by using what we call stackless coroutines, and combining Rust’s futures with async/await is an example of that. We will cover this in detail in the next chapters.

This first chapter will introduce Rust’s futures to you, and the main goals of this chapter are to do the following:

  • Give you a high-level introduction to concurrency in Rust
  • Explain what Rust provides and not in the language and standard library when working with async code
  • Get to know why we need a runtime library ...

Get Asynchronous Programming in Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.