Rs Course · 49 lessons · approx. 335 minutes

Learn Rust

Rust is a programming language for fast programs and system software. Among other things, the compiler checks how your program uses values. Here you learn the basics and a first safe way of working with borrowed data, without requiring any prior knowledge. Every new building block is first explained on short pages. The coding exercises compare solution patterns without pretending to be a compiler; you can run free programs in the compiler with a suitable runtime.

  • Hallo, Rust!
  • let and mut
  • Types and text
  • Calculating with numbers
  • bool and comparisons
  • if and else
  • for and number ranges
  • Borrowing text
  • fn: returning a result
  • Your Rust points coach
  • struct: bundling named fields
  • Option: present or not present
  • Result: success or error
  • iter and sum: adding up borrowed values
  • match: checking ranges
  • impl: methods for a struct
  • Vec: a growing list
  • enum with data
  • trait: shared behaviour
  • Texts and iterators
  • Ownership and borrowing
  • Collections and errors
  • Structs and methods
  • Enums and match
  • Traits

What you’ll learn

  1. 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
  2. Chapter 2Deciding and repeating – Check values and control small sequences.
    bool and comparisons · if and else · for and number ranges
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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.

Learn Rust now