Tour of Rust Table of Contents

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!

In Rust there is not a 1 to 1 mapping of files to the module tree heirarchy. We must build the module tree explicitly by hand in our code.