singularity

Chapter 7: Managing Growing Projects with Packages, Crates, and Modules

Packages and Crates

package
  binary crate
    root module
      module
      module
      module
      ...
  library crate 
    root module
      module
      module
      module
      ...

Defining Modules to Control Scope and Privacy

Paths for Referring to an Item in the Module Tree

Exposing Paths with the pub Keyword

Starting Relative Paths with super

Making Structs and Enums Public

Bringing Paths into Scope with the use Keyword

Creating Idiomatic use Paths

Providing New Names with the as Keyword

Re-exporting Names with pub use

Using External Packages

Using Nested Paths to Clean Up Large use Lists

The Glob Operator

Separating Modules into Different Files