mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-07-06 11:07:12 -06:00
ch7.0 + 7.1 finished
This commit is contained in:
18
Project Organization.md
Normal file
18
Project Organization.md
Normal file
@ -0,0 +1,18 @@
|
||||
# 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**: lets you control the organization, scope and privacy of paths
|
||||
- **Paths**: A way of naming an item, such as a struct, function or module
|
Reference in New Issue
Block a user