Rust Book
This is a personally annotated copy of the "The Rust Programming Language"1.
Why Rust
For me, I've never really been exposed to low-level systems programming, having majored in Informatics at UC Irvine precisely to avoid it (and well, math). My first language was Visual Basic 6, and even though I've grown to love strong, static langauges, I've never really used C, or anything like it, for anything substantial.
I'd love to Rust to learn more about:
- Lower-level system details, such as memory usage
- Using non-traditional languages
- Mastering the borrow checker
Rust, is well, also pretty cool:
This repository
Every chapter in the book receives its own folder, i.e. chapter/01-getting-started
:
-
🟢 Getting Started -
🟢 Programming a Guessing Game -
?? Common Programming Concepts -
🟢 Understanding Ownership -
🟢 Using Structs to Structure Related Data -
🟢 Enums and Pattern Matching -
🟢 Managing Growing Projects -
🟢 Common Collections -
🟢 Error Handling -
🟢 Generic Types, Traits, and Lifetimes -
🟢 Writing Automated Tests -
🟢 An I/O Project: Building a Command Line Program -
🟢 Functional Langauge Features: Iterators and Closures -
🟢 More about Cargo and Crates.io -
🟢 Smart Pointers -
🟢 Fearless Concurrency -
🟢 Object Oriented Programming Features of Rust -
🟢 Patterns and Matching -
🟢 Advanced Features -
🟢 Final Project: Building a Multithreaded Web Server
Unless otherwise specified, the only tools required to be installed are:
- An IDE (VSCode with
rust-analyzer
preferred, but any will do). - Rustup and Cargo, often through the official website.
- A linker, such as
xcode-select
,Clang
, orMSVC
.
When possible, copies of other source material, such as PDFs or images, should be cached in this repository so that the only thing required to interact with this repository is an installation of Rust, an IDE, a linker, and a clone.
To verify, run ./CHECK.sh
.
Creating a new chapter
cargo new chapter/00-chapter-name --name chapter-name --vcs none
Then, edit Cargo.toml and add the new workspace member:
members = [
# ...
"chapter/00-chapter-name",
]
Adding dependencies
cargo add package-name -p chapter-name
Footnotes
-
Available at https://doc.rust-lang.org/book/, or
rustup docs --book
.↩