What the Rust language and standard library take care of
Rust only provides what’s necessary to model asynchronous operations in the language. Basically, it provides the following:
- A common interface that represents an operation, which will be completed in the future through the
Future
trait - An ergonomic way of creating tasks (stackless coroutines to be precise) that can be suspended and resumed through the
async
andawait
keywords - A defined interface to wake up a suspended task through the
Waker
type
That’s really what Rust’s standard library does. As you see there is no definition of non-blocking I/O, how these tasks are created, or how they’re run. There is no non-blocking version of the standard library, so to actually run an asynchronous program, you have to either create or decide on a runtime to use.