Cargo.toml is the manifest at the root of a Rust project. It records package metadata and dependencies, while Cargo uses it to coordinate compilation and produce executables. section 1.3.1 section 2.15
A project manifest
A small command-line project can declare its identity and libraries like this: [package] name = "clock", version = "0.1.1", authors = ["Tim McNamara <author@rustinaction.com>"], edition = "2018"; [dependencies] chrono = "0.4", clap = "2". Cargo reads these declarations when building the program. section 9.6.4
Common manifest sections describe different parts of a project:
- [lib] selects library metadata and a source path, while repeated [[bin]] sections define executable names and source paths. section 7.5.2
Cargo.toml works with the generated project structure: source files normally live in src, while Cargo manages build artifacts in target. After a build, Cargo.lock records exact dependency versions so later builds remain reproducible until the manifest changes. section 1.3.1



