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

Using Cargo to Build Your First Program

Now that we have some Rust under our belts, we can start with our project. Before we can do that, however, we will take a deeper look at the Cargo program and how it is used to declare project metadata and dependencies and build Rust projects.

This chapter will cover the following topics:

  • The Cargo build tool
  • cargo init: starting a project
  • cargo build: building a project
  • cargo test: running tests and benchmarks
  • cargo search: searching crates: third-party libraries
  • How to write Cargo.toml to configure your project
  • Editor integrations

As a final exercise, we'll start the project that will be a basis for the rest of the book.

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