mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-06-16 05:24:17 -06:00
19 lines
1.0 KiB
Markdown
19 lines
1.0 KiB
Markdown
# Packages, Modules and Crates
|
|
|
|
Projects should generally group related code/function together this increases code organization
|
|
|
|
packages can contain multiple binary codes/files or a library crate
|
|
|
|
very large projects should be done with interrelated packages that all update should be done using cargo workspaces
|
|
|
|
encapsulation is useful because you don't need to worry about its implementation
|
|
this is good for reusing code
|
|
|
|
rust has features for your code's organization, which parts are exposed, which details are private and what names are in each scope in the program
|
|
|
|
These features are known collectively as the ``module system`` they include
|
|
- [**Packages**](Packages.md): A feature of Cargo that allows you to build, test and share crates
|
|
- [**Crates**](Crates.md): A tree of modules that produces a library or an executable
|
|
- [**Modules** and **use**](Modules%20and%20Use.md): lets you control the organization, scope and privacy of paths
|
|
- **Paths**: A way of naming an item, such as a struct, function or module
|