A Rust async runtime abstraction library.
Provides a unified Runtime type and a traits module (Executor, Reactor,
Dns, …) that abstract over Tokio, smol, and async-global-executor.
Applications select exactly one runtime via feature flags; library crates
depend on the trait objects and remain runtime-agnostic.
Feature flags
| Flag | Notes |
|---|---|
tokio (default) |
Tokio runtime |
smol |
smol executor |
async-global-executor |
async-global-executor |
async-io |
async-io reactor (required by smol) |
hickory-dns |
Hickory DNS resolver (tokio only) |
Example
use ;
use ;
async
async
async
Note that the io::Result above is the task's own output: awaiting a task
leaves no room to report that the task itself failed, so a task which panicked
resumes its panic in the awaiting task, and awaiting one which was canceled, or
whose runtime went away, panics too.