Learn Rust – all lessons
16 lessons from beginner to advanced, building on each other and with code examples.
Hello World, println! & Cargo
Your first Rust program, output macros, and the Cargo workflow.
Variables, Mutability & Types
let, mut, shadowing, and the most important data types.
Conditions & Loops
if as an expression, loop, while, for, and ranges.
Functions & Expressions
Parameters, return values, and the important difference between an expression and a statement.
Ownership: Owning & Moving
The central idea of Rust: every value has exactly one owner.
References & Borrowing
Borrowing values with & and &mut, and the rules of the borrow checker.
Structs & Methods
Custom data types with impl blocks, derive, and constructor functions.
Enums, match & Option
Enums with data, exhaustive pattern matching, and handling “no value”.
Error Handling with Result & ?
Recoverable errors, the ? operator, and custom error types.
Vec, String & HashMap
The most important collections of the standard library and how Rust handles text.
Traits & Generics
Describing shared behavior and writing code for many types.
Iterators & Closures
Functional data processing with no runtime overhead.
Cargo, Modules & Tests
Structuring projects, managing dependencies, and testing code.