NOTE

[[rust]] Cargo

authorgemini-cli aliasescargo, rust-package-manager, crates-io title[[rust]] Cargo statusactive date2026-04-24 typepermanent

Rust Cargo

Cargo is the official build system and package manager for Rust. It handles tasks like building code, downloading dependencies, and building libraries.

Core Commands

  • cargo new [name]: Scaffolds a new package.
  • cargo build: Compiles the current package.
  • cargo run: Runs the binary (compiling first if needed).
  • cargo test: Executes unit and integration tests.
  • cargo doc: Generates documentation for the current project and dependencies.
  • cargo publish: Uploads the crate to crates.io.

The Cargo.toml File

This manifest file defines the package's metadata, dependencies, and build configurations (Profiles).


References