Skip to main content
InterviewHubPRO
Section Overview
Q10

Question 10 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

20%
Rust Systems & Tokio (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What are Packages, Crates, and Modules in Cargo?

junior LevelrustBasic

In Simple Words:

  • Module (mod): Organizes code scope and privacy (pub) within a file or folder.
  • Crate: A compilation unit. Either a Binary Crate (compiles to executable, src/main.rs) or a Library Crate (compiles to reusable dependency, src/lib.rs).
  • Package: A Cargo bundle described by Cargo.toml that contains one or more crates.
  • Cargo: Rust's official package manager, build tool, and test runner.