Originally published on php2rust.dev — part of the PHP to Rust course. View this lesson on the original site.
When you create a new Rust project with Cargo, it generates Cargo.toml, the project manifest. This file holds metadata (name, version, authors, edition) and dependencies.
The .toml format (TOML: Tom's Obvious, Minimal Language) is human-readable and easy to edit. It's used for dependencies, build settings, and other configuration.
Example structure:
[package]
name = "my_project"
version = "0.1.0"
edition = "2024"
[dependencies]
In [dependencies], you add external crates (Rust libraries). You can edit this section by hand or use Cargo commands like cargo add to manage dependencies automatically.
What's next
Next: Installing dependencies from Crates.io.
From PHP to Rust — Getting Started with Rust