官术网_书友最值得收藏!

  • Mastering Rust
  • Rahul Sharma Vesa Kaihlavirta
  • 102字
  • 2021-07-02 13:35:19

Modules

Before we explore more about Cargo, we need to be familiar with how Rust organizes our code. We had a brief glimpse at modules in the previous chapter. Here, we will cover them in detail. Every Rust program starts with a root module. If you are creating a library, your root module is the lib.rs file. If you are creating an executable, the root module is any file with a main function, usually main.rs. When your code gets large, Rust lets you split it into modules. To provide flexibility in organizing a project, there are multiple ways to create modules.

主站蜘蛛池模板: 鄂尔多斯市| 浦县| 探索| 柘城县| 邯郸市| 林口县| 东光县| 利津县| 永年县| 鹰潭市| 科技| 广东省| 静安区| 宜宾县| 稷山县| 江北区| 昌黎县| 清丰县| 常州市| 安化县| 陕西省| 河间市| 香河县| 鹰潭市| 繁峙县| 赞皇县| 景宁| 海原县| 莒南县| 老河口市| 娄底市| 都兰县| 册亨县| 南丹县| 稻城县| 鹰潭市| 涞水县| 崇礼县| 宾川县| 绵阳市| 甘德县|