Crates, Packages, and Cargo Workspaces

Updated

October 31, 2026

Crates, Packages, and Cargo Workspaces

  • Crate: The smallest compilation unit in Rust (a library or binary).
  • Package: One or more crates defined by a Cargo.toml.
  • Workspace: A set of packages that share a single Cargo.lock and output directory (target/).
# Top-level Cargo.toml for workspace
[workspace]
members = [
    "crates/server",
    "crates/core",
    "crates/client"
]