async-std異步的 Rust 標準庫
async-std 是 Rust 標準庫的異步版本。
入門
首先在Cargo.toml添加如下內(nèi)容:
[dependencies] async-std = "0.99"
或者使用 cargo add :
$ cargo add async-std
Hello world
#![feature(async_await)]
use async_std::task;
fn main() {
task::block_on(async {
println!("Hello, world!");
})
}
評論
圖片
表情
