January 2018
Beginner to intermediate
454 pages
10h 8m
English
Let's try to build a Rust program. First, create a new project with cargo:
$ cargo new --bin hello_world Created binary (application) `hello_world` project
The --bin flag indicates that we want to create an executable project, as opposed to a library (which is the default without this flag). In the Rust world, a crate is a package of libraries and/or executable binaries.
This created a hello_world directory containing the following files and directory:
$ tree hello_world/ hello_world/ ├── Cargo.toml └── src └── main.rs 1 directory, 2 files
The Cargo.toml file is where the metadata (name, version, and so on) of your project resides, as well as its dependencies. The source files of your project are in the src directory. ...
Read now
Unlock full access