liveBook · Manning

Cargo run

cargo run is a Cargo command that builds and executes a Rust package’s binary target.

How 2 Manning books explain it

Learn Rust in a Month of Lunches

cargo run is a Cargo subcommand that builds and runs a Rust binary target while resolving its dependencies.

How it is used
Uses Cargo to build and run a Rust program while bringing in its dependencies.
How deep it goes
Walks through compilation output and a repeat run that reuses previously compiled dependencies.
Examples
Runs a random-letter program using rand, then adds a letter and runs it again.
What you can do after
Apply it via Cargo to build and test a program with an external crate.

Read how Learn Rust in a Month of Lunches explains cargo run →

Rust in Action: Systems programming concepts and techniques

cargo run is a Cargo subcommand that builds a Rust project and executes its resulting binary.

How it is used
Uses Cargo to build and execute Rust projects from a console.
How deep it goes
Explains project setup, build artifacts, release and quiet flags, and verbose compiler output.
Examples
Runs a generated Hello world project and a CSV-processing program with debug, release, and quiet output.
What you can do after
Apply it via Cargo to build and run a project, select a release build, or inspect compilation commands.

Read how Rust in Action: Systems programming concepts and techniques explains cargo run →

Also covered in

What to know first

Related concepts

Questions about cargo run

What is cargo run?

cargo run is a Cargo command that builds and executes a Rust package’s binary target.

Which Manning books explain cargo run?

Learn Rust in a Month of Lunches and Rust in Action: Systems programming concepts and techniques.

What should I know before learning cargo run?

Manning books that teach cargo run usually introduce application, crate, generics and Rust first.

What is the difference between cargo run and cargo build?

cargo run is a Cargo command that builds and executes a Rust package’s binary target. cargo build is a Cargo command that compiles a Rust package and produces build artifacts without running them.

What is cargo run part of?

Cargo run is part of Cargo. Cargo is Rust’s package manager and build tool for managing projects and dependencies and for building, testing, and running Rust code.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.