What you’ll learn
- Chapter 1From the first character to your own value – Starting point, output, variables and calculating.
Hallo, Rust! · let and mut · Types and text · Calculating with numbers - Chapter 2Deciding and repeating – Check values and control small sequences.
bool and comparisons · if and else · for and number ranges - Chapter 3Your own building blocks and a mini project – Organise data, build functions and connect what you have learned.
Borrowing text · fn: returning a result · Your Rust points coach - Chapter 4Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
struct: bundling named fields · Option: present or not present · Result: success or error · iter and sum: adding up borrowed values - Chapter 5Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
match: checking ranges · impl: methods for a struct · Vec: a growing list · enum with data · trait: shared behaviour - Chapter 6Texts and iterators – Extend and format Strings, loop through characters and chain iterators.
Letting a String grow · format! and placeholders · Looping through characters: chars · filter, map and collect · Boss: text statistics - Chapter 7Ownership and borrowing – Moving and cloning, & and &mut, slices, lifetimes and borrowing functions.
Moving or cloning · Borrowing: & and &mut · Slices: borrowing sections · Lifetimes with 'a · Boss: a course list without duplicates - Chapter 8Collections and errors – HashMap with entry, sorting by key, the ? operator, while let and a grade book.
HashMap and entry · Sorting with sort_by_key · Passing errors on with ? · if let and while let · Boss: reading in a grade book - Chapter 9Structs and methods – Bundle data, attach methods with impl, &self and &mut self, constructors and debug output.
Bundling data: struct · Attaching methods: impl and &self · Changing values: &mut self · Constructor and debug output · Boss: an inventory - Chapter 10Enums and match – Fixed choices with enum, variants with data, match with ranges and conditions, Option methods.
A fixed choice: enum and match · Variants with data · match with ranges and conditions · Using Option comfortably: unwrap_or and map · Boss: a drinks machine - Chapter 11Traits – Shared behaviour with trait, default methods, trait bounds on generics, Display and Box<dyn Trait>.
Shared behaviour: trait · Default methods in a trait · Generics with trait bounds · Your own output: impl Display · Boss: shapes with Box<dyn Trait>
Final project: Rust points coach
Combine variables, a decision and an output into your own points coach.
How it works
Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.