Add the tokio crate with the rt-multi-thread feature and use the #[tokio::main] macro to run async functions.
Add tokio to your Cargo.toml with the rt-multi-thread feature and use #[tokio::main] to run your async code.
[dependencies]
tokio = { version = "1", features = ["rt-multi-thread"] }
use tokio;
#[tokio::main]
async fn main() {
println!("Hello from async Rust!");
}
Tokio is a tool that lets your Rust program do multiple things at once without getting stuck waiting for slow tasks like network requests. Think of it like a kitchen manager who assigns different chefs to different dishes so the whole meal gets ready faster. You use it whenever you need your program to handle many connections or tasks simultaneously.