Free through lesson 3

Rust for Beginners

From setting up your environment through conditionals, loops, data structures, ownership, functions, structs and traits, all the way to debugging. Fifty lessons that take you to the point where you can read Rust, write it, and hold a conversation with the compiler. Every piece of code shown actually compiles.

about 1 hours in total (estimate)

Slides for this course (for classes and in-house training) →

Curriculum

The 50 lessons are grouped into seven chapters. Working through them in order is the best way, but you are welcome to dip into whatever interests you. Note: Rust cannot run inside the browser, so try the code locally or in the Rust Playground (play.rust-lang.org).

Chapter 1 — Getting started (lessons 1–8)

From setting up your environment through println!, variables, numbers and strings, to reading compiler errors. Come out the other side and you can write code, compile it, and fix it.

Chapter 2 — Control flow (lessons 9–15)

Branch with if, repeat with loop, while and for. You gather the tools that give a program its flow, and finish by building a number-guessing game with an external crate.

Chapter 3 — Data structures (lessons 16–24)

Vec, HashMap, HashSet, tuples and iterators. This is also where we take on ownership and borrowing — the heart of Rust — head-on.

Chapter 4 — Functions (lessons 25–32)

Give a piece of work a name and pull it out. You go as far as slices, closures and generics, then tidy long code by splitting it into functions.

Chapter 5 — Error handling and files (lessons 33–39)

Result and Option in place of exceptions, propagation with ?, files, JSON and splitting into modules. This is the foundation of a program people actually use.

Chapter 6 — Structs and traits (lessons 40–46)

Data in a struct, behavior in an impl, shared promises in a trait. You finish by designing an inventory system with structs.

Chapter 7 — Going further (lessons 47–50)

Cargo and external crates, writing your own iterators, debugging and testing. This chapter hands you the map for everything beyond the course.

Once you have finished all 50 lessons, move on to lifetimes, concurrency and async/await. Membership unlocks every course.