Modules
-
Every Rust program or library is a crate
-
Every crate is made of a hierarchy of modules
-
Every crate has a root module
-
A module can hold global variables, functions, structs, traits or even other modules!
-
A program has a root module in a file called
main.rs
-
A library has a root module in a file called
lib.rs