The Cargo.toml Builder generates the manifest at the heart of every Rust project. Choose whether you are building a binary or a library, pick the crates you need, and the tool emits a complete [package], [dependencies], [dev-dependencies] and release profile.
How it works
[package] holds the crate name, version, edition, authors and license. The target section is either [[bin]] (an executable from src/main.rs) or [lib] (a reusable library from src/lib.rs). [dependencies] lists each crate you selected, using Cargo’s table syntax when features are needed — for example serde is emitted as serde = { version = "1.0", features = ["derive"] } so the derive macros are enabled.
Cargo treats a bare version string as a caret requirement: "1.0" resolves to any 1.x release at or above 1.0.0. The exact versions Cargo actually selects are written to Cargo.lock on first build, which is what makes builds reproducible.
Example
After saving the manifest, build to lock dependencies:
cargo build # resolves versions, writes Cargo.lock
cargo build --release # optimized build using [profile.release]
Tips and notes
Keep test-only crates such as criterion and tokio-test in [dev-dependencies] so consumers of your library never compile them. Commit Cargo.lock for binaries to pin exact versions; for libraries it is conventional to leave it out so downstream projects resolve their own tree. The release profile enables lto and codegen-units = 1 for faster, smaller binaries — these only affect --release builds, so day-to-day debug compiles stay quick.