• [Rust] 模块与文件分离

    我们可以让模块不再平铺在目录里面,把他移入文件文件夹中。 src ├── front_of_house │ └── hosting.rs ├── front_of_house.rs └── lib.rs //lib.rs mod front_of_house;//导入当前目录下的front_of

  • [Rust] 多线程并发访问

    // main.rs use futures::future::join_all; use reqwest::Client; use std::sync::Arc; use tokio::sync::Semaphore; use tokio::task; // 引入join_all #[tokio