Using Cargo

When you start reading about Rust, you will soon meet Cargo, the standard tool used in the Rust ecosystem to build and run Rust applications. Here we want to give a brief overview of what Cargo is and how it fits into the wider ecosystem and how it fits into this training.

Installation

Please follow the instructions on https://rustup.rs/.

This will give you the Cargo build tool (cargo) and the Rust compiler (rustc). You will also get rustup, a command line utility that you can use to install to different compiler versions.

After installing Rust, you should configure your editor or IDE to work with Rust. Most editors do this by talking to the language server rust-analyzer, which provides functionality like auto-completion and jump-to-definition for VS Code, Helix and many others. There is also a different IDE available called RustRover (proprietary and paid, not recommended).

  • On some Linux distributions, you can install Rust from the distribution’s repositories. But this is not recommended (at least for the course) since you might get an outdated version or miss some components.