I've recently come to try out workspaces in Rust and I love them. Rust workspaces are groups of crates that work together. Here are some selling points:
Setting up couldn't be simpler - all you need is a single Cargo.toml
file with a single section that defines what crates you have in the workspace. Example:
[workspace]
members = ["api", "core", "cli"]
All of your crates within the workspace have a common Cargo.lock
that lives in the main directory. This means that however many crates depend on the same 3rd party crate - they will all have the same locked version. No need to wrangle different versions of the same crate - Yay!
Workspaces make it easy to have multiple binaries in the same project. Example - you want to make a CLI utility that:
With a workspace you can have the CLI and web API executables share the same core library all in one neat little project.
Tests - good; individual crate tests - good; running them all at once - good! Why use big words when small words do trick?