Cargo is a unique offering from Rust and is very new in the sphere of system programming. It is also one of the selling points of Rust, as it enables developers to package, ship, and test their Rust application.
We will cover a lot of functionalities of Cargo in this chapter.
- Open the Terminal.
- Go to the directory where you want to create the project:
cd project_location
- Enter the following command to create a new Rust project:
cargo new project_name --bin
Create a project named hello_world
, as shown in the following example:
cargo new hello_world --bin
You should get the following output:
- You should have a new folder created with the name of the project.
First, get into the project and examine it:
cd hello_world tree .
You should get the following output:
This is the whole structure of the newly created project.
- Print the content of the
Cargo...