Building crates
At the highest level, there is the crate. The Rust distribution contains a number of crates, such as the std crate of the standard library, which we have already used often. Other built-in crates include the collections crate, with functionality to work with strings, vectors, linked lists, and key-value maps, and the test or rustc-test crates, with unit-testing and micro-benchmarking functionality.
A crate is the equivalent of a package or library in other languages. It is also the unit of compilation: rustc only compiles one crate at a time. What does this mean? When our project has a code file containing a main() function, then it is clear that our project is an executable program (also called a binary), starting execution ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access