Skip to content

Instantly share code, notes, and snippets.

@masakielastic
Last active August 22, 2025 15:19
Show Gist options
  • Select an option

  • Save masakielastic/87867f4b56cb5979a9c60b9813bbf2b0 to your computer and use it in GitHub Desktop.

Select an option

Save masakielastic/87867f4b56cb5979a9c60b9813bbf2b0 to your computer and use it in GitHub Desktop.
Tokio で Hello World。async/await 実行の最小構成

Tokio で Hello World。async/await 実行の最小構成

Cargo.toml

[package]
name = "tokio"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }

src/main.rs

async fn hello() {
    println!("Hello, world!");
}

#[tokio::main]
async fn main() {
    hello().await;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment