Dependency Management

While Rust has a relatively early ecosystem of libraries, it is a strong ecosystem for a variety of domains. The main place you find a crate is on, fittingly, crates.io.

After you search for a crate on there, and you want to add it, you can run a simple command. For example, to add the popular serialization/deserialization crate serde, you would run

cargo add serde

This would add the latest version. If you want to add it manually, you can specify the version in Cargo.toml with a line like serde = "1.0.154".

The version you specify is matched with semver. To avoid just repeating the docs, I refer you to the official docs if you want to do something more advanced or want to understand how it's handling version matching.