Package Layout
Cargo uses conventions for file placement to make it easy to dive into a newCargo package:
1. .
2. ├── Cargo.lock
3. ├── Cargo.toml
4. ├── benches
5. │ └── large-input.rs
6. ├── examples
7. │ └── simple.rs
8. ├── src
9. │ ├── bin
10. │ │ └── another_executable.rs
11. │ ├── lib.rs
12. │ └── main.rs
13. └── tests
14. └── some-integration-tests.rs
Cargo.tomlandCargo.lockare stored in the root of your package (packageroot).- Source code goes in the
srcdirectory. - The default library file is
src/lib.rs. - The default executable file is
src/main.rs. - Other executables can be placed in
src/bin/*.rs. - Integration tests go in the
testsdirectory (unit tests go in each filethey're testing). - Examples go in the
examplesdirectory. - Benchmarks go in the
benchesdirectory.These are explained in more detail in the manifestdescription.
