O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dependencies, building, and running

Before we can cover building and running, let's discuss a bit about dependency versioning. Cargo has two files that cover dependency versions: Cargo.toml is the file where you, as the coder, write dependencies and their wanted versions and Cargo.lock is a generated file that contains fixed versions of the said dependencies.

Depending on the stability requirements of your project, you might want your dependencies to be deterministic, never to change without you specifically requesting for it. With Cargo, you can define in rather broad strokes what version of dependencies you wish to include and then lock the dependency to a specific changeset or version.

For example, you might want to include the serialization ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required