- 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.
推薦閱讀
- 玩轉Scratch少兒趣味編程
- SOA實踐
- C語言程序設計基礎與實驗指導
- 基于Java技術的Web應用開發
- iOS開發實戰:從零基礎到App Store上架
- Python 3網絡爬蟲實戰
- Windows Phone 7.5:Building Location-aware Applications
- ASP.NET開發與應用教程
- Advanced Express Web Application Development
- C++編程兵書
- Angular應用程序開發指南
- Deep Learning with R Cookbook
- Python面試通關寶典
- C# 7.1 and .NET Core 2.0:Modern Cross-Platform Development(Third Edition)
- ROS機器人編程實戰