How it works
Rust's async functions do nothing on their own; they need a runtime to schedule them. Tokio provides one, with a pool of worker threads that run tasks whenever they can make progress, plus async versions of TCP and UDP sockets, timers, file access, channels and locks. A #[tokio::main] attribute on main starts it.
Much of the Rust networking world is built on it: the reqwest HTTP client, the hyper and axum web servers, the sqlx database library and tonic for gRPC. Tauri uses it as its default async runtime. The main rule is never to block a Tokio thread with long CPU work or blocking calls; spawn_blocking moves such work to a separate thread pool.
Tokio pricing
Related terms
More in Desktop apps
Rust building blocks