Skip to content
binshelf/ rust

Search lessons

Type a Rust, TypeScript or C# term, like Option, null or E0382.

    Compare Rust with

    Lessons

    14 modules, from first steps to async and unsafe Rust. 40 of 40 lessons are ready; the rest are listed so you can see where the course is going.

    1. Module 0 Orientation & tooling

      Why Rust works without a garbage collector, and the tools you'll use every day: rustup, Cargo, clippy and rustfmt.

      1. 0.1Why Rust, and the mental model shift
      2. 0.2Tooling, Cargo & project layout

    2. Module 1 Fundamentals

      Variables, mutability, shadowing, number types and functions, why almost everything in Rust is an expression, and what Rust's punctuation means.

      1. 1.1Variables, mutability & shadowing
      2. 1.2Primitive & compound types
      3. 1.3Functions, expressions & statements
      4. 1.4Reading Rust's symbols: &, *, ', ::, ! and ?

    3. Module 2 Ownership & memory

      Where values live, who frees them, and why assigning a String moves it instead of sharing it.

      1. 2.1Stack vs. heap
      2. 2.2Ownership and move semantics
      3. 2.3Copy vs. Clone

    4. Module 3 Borrowing & slices

      Lending values without giving them away: shared and mutable references, zero-copy slices, and how to choose what a function takes.

      1. 3.1References: &T and &mut T
      2. 3.2Slices: &str and &[T]
      3. 3.3Choosing parameter types: T, &T, &mut T or Box<T>

    5. Module 4 Control flow & pattern matching

      if and loop as expressions, exhaustive match, and the short forms: if let, while let and let-else.

      1. 4.1Loops & conditional expressions
      2. 4.2Exhaustive match & destructuring
      3. 4.3if let, while let & let-else

    6. Module 5 Structs, methods & enums

      Data and behavior without classes or inheritance, and enums that carry data.

      1. 5.1Structs & impl blocks
      2. 5.2Enums with data

    7. Module 6 Nullability & error handling

      Option instead of null, Result instead of exceptions, and the ? operator.

      1. 6.1Option instead of null
      2. 6.2Result and the ? operator
      3. 6.3Panics, custom errors, thiserror & anyhow

    8. Module 7 Modules & crates

      Organizing code with modules and visibility, and projects with crates, workspaces and features.

      1. 7.1Modules, visibility & paths
      2. 7.2Crates, workspaces & features

    9. Module 8 Collections & strings

      Vec, HashMap and friends, and why Rust strings are UTF-8 and can't be indexed by position.

      1. 8.1Vec, HashMap, HashSet & BTreeMap
      2. 8.2Strings: UTF-8 vs UTF-16

    10. Module 9 Traits & generics

      Rust's answer to interfaces, generic bounds, static vs. dynamic dispatch, and the standard traits.

      1. 9.1Traits
      2. 9.2Generics, bounds & where
      3. 9.3impl Trait vs. dyn Trait
      4. 9.4Standard traits

    11. Module 10 Closures & iterators

      Closures and what they capture, and lazy iterator chains that compile to plain loops.

      1. 10.1Closures & Fn, FnMut, FnOnce
      2. 10.2Lazy iterators

    12. Module 11 Lifetimes & smart pointers

      How long references are valid, deterministic cleanup with Drop, and shared ownership when you need it.

      1. 11.1Lifetimes
      2. 11.2Drop & smart pointers
      3. 11.3Shared ownership & interior mutability

    13. Module 12 Concurrency & async

      Threads and channels, compile-time thread safety with Send and Sync, and async Rust with Tokio.

      1. 12.1Threads, channels & shared state
      2. 12.2Send & Sync
      3. 12.3Async, futures & Tokio

    14. Module 13 Testing, macros & unsafe

      Built-in tests and doc tests, macros and serde, what unsafe Rust is for, and running Rust in the browser with WebAssembly.

      1. 13.1Tests & doc tests
      2. 13.2Macros & serde
      3. 13.3unsafe & FFI
      4. 13.4Rust & WebAssembly