Chapter 4: Rustc and Cargo

This chapter provides a brief overview of Rust's compiler, rustc, and its dedicated build tool and package manager, Cargo. Rust often uses external libraries—called crates—for essential functionality (for example, generating random numbers). Here, we'll explain how to use Cargo to add external libraries, compile your code, manage your project, and use some additional tools that make Rust development smoother. This introduction should give you enough to get started. For an in-depth look at Cargo, see Chapter 23.