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.tomlthat contains one or more crates. - Cargo: Rust's official package manager, build tool, and test runner.