April 2026
Intermediate
631 pages
16h 20m
English
Typical code in Rust is synchronous, which executes line by line in sequential order without yielding control back to the runtime. However, Rust provides the ability to write asynchronous code as well so you can write function closures and blocks that can pause execution and yield control back to the runtime. In this way, you can allow other code to make progress and then pick back up from where they left off. The pauses to wait for are generally for some input or output to occur. Due to this rather yielding nature, this approach is also sometimes called cooperative scheduling, as it gives control back to the executor or runtime, thereby cooperatively allowing other code to make progress and execute.
Read now
Unlock full access