Understanding Cargo.toml

The Complete Guide

Cargo.toml is the manifest file that defines your Rust project's metadata, dependencies, and build configuration.

Cargo.toml is the manifest file that defines your Rust project's metadata, dependencies, and build configuration. It tells Cargo how to compile your code and manage external crates.

[package]
name = "my_project"
version = "0.1.0"
edition = "2024"

[dependencies]
rand = "0.8"

The [package] section sets the project name, version, and Rust edition. The [dependencies] section lists external crates required to build your project.