الوحدات (Modules)
We have seen how impl
blocks let us namespace functions to a type.
Similarly, mod
lets us namespace types and functions:
Speaker Notes
This slide should take about 3 minutes.
- Packages provide functionality and include a
Cargo.toml
file that describes how to build a bundle of 1+ crates. - Crates are a tree of modules, where a binary crate creates an executable and a library crate compiles to a library.
- Modules define organization, scope, and are the focus of this section.