Guide contents

Rust Programming

Learn Rust from Hello, world to unsafe, macros, and async internals.

94 lessons in 19 sections

Start with Introduction: How This Course Works →

Getting Started

Install Rust, use Cargo, and print output.

  1. 1.Introduction: How This Course Works
  2. 2.What Is Rust? A Complete Overview
  3. 3.Installing Rust & Cargo
  4. 4.Hello World & Printing Output

Language Basics

Variables, types, functions, and control flow.

  1. 5.Variables & Mutability
  2. 6.Scalar Types: Integers, Floats, Booleans & Characters
  3. 7.Functions
  4. 8.Control Flow: if, loop, while, for & match
  5. 9.Tuples & Arrays
  6. 10.A First Look at String, Vec & HashMap

Ownership & Borrowing

Moves, borrowing, and references.

  1. 11.Ownership: The Three Rules
  2. 12.Move, Copy & Clone
  3. 13.Ownership & Functions
  4. 14.References & Borrowing
  5. 15.Mutable References
  6. 16.Slices: &str and &[T]
  7. 17.Strings in Depth: String vs &str
  8. 18.Ownership & Borrowing with Collections

Structs, Enums & Pattern Matching

Structs, enums, Option, and Result.

  1. 19.Structs
  2. 20.Methods & Associated Functions
  3. 21.Enums: Types With Variants
  4. 22.Option: Replacing null
  5. 23.Pattern Matching in Depth
  6. 24.Result & the ? Operator

Lifetimes

Lifetime annotations and borrow checker errors.

  1. 25.Lifetimes in Functions
  2. 26.Lifetimes in Structs & Methods
  3. 27.Lifetime Elision & 'static
  4. 28.Fixing Borrow Checker Errors

Traits & Generics

Traits, generics, and dispatch.

  1. 29.Traits: Rust's Interfaces
  2. 30.Deriving Standard Traits
  3. 31.Generics
  4. 32.Trait Bounds & where Clauses
  5. 33.Trait Objects & Dynamic Dispatch
  6. 34.Advanced Traits
  7. 35.Conversion Traits: From, Into, TryFrom, FromStr, AsRef

Closures & Iterators

Closures and iterators.

  1. 36.Closures
  2. 37.Fn, FnMut & FnOnce
  3. 38.Iterators
  4. 39.Iterator Adapters: The Complete Cookbook
  5. 40.Custom Iterators

Collections

Vec, HashMap, HashSet, and other collections.

  1. 41.Vec in Depth
  2. 42.HashMap
  3. 43.HashSet
  4. 44.BTreeMap & BTreeSet
  5. 45.VecDeque & BinaryHeap

Modules, Crates & Testing

Modules, workspaces, and tests.

  1. 46.Modules & Visibility
  2. 47.Crates, Packages & Workspaces
  3. 48.Testing

Error Handling

Error types, thiserror, and anyhow.

  1. 49.Custom Error Types
  2. 50.thiserror & anyhow
  3. 51.Error Handling Patterns

Files, I/O & the Command Line

Files, standard input and output, and command-line tools.

  1. 52.Reading & Writing Files
  2. 53.Paths & Directories
  3. 54.Standard Input, Output & Error
  4. 55.Command-Line Arguments, Environment & Processes

Smart Pointers

Box, Rc, RefCell, and other smart pointers.

  1. 56.Box: Heap Allocation
  2. 57.Rc & Weak: Shared Ownership
  3. 58.Cell & RefCell: Interior Mutability
  4. 59.Drop, Deref & Cow

OOP & Design Patterns

OOP concepts and design patterns in Rust.

  1. 60.OOP Concepts in Rust
  2. 61.Creational Patterns
  3. 62.Structural Patterns
  4. 63.Behavioral Patterns

Concurrency

Threads, channels, and shared state.

  1. 64.Threads
  2. 65.Shared State: Arc, Mutex & RwLock
  3. 66.Channels: Message Passing
  4. 67.Atomics, Send & Sync

Async Rust

Futures, Tokio, and async Rust.

  1. 68.Async Fundamentals
  2. 69.Tokio Patterns: select!, JoinSet & Friends
  3. 70.Async Channels & Locks
  4. 71.Async Traits
  5. 72.Async Streams
  6. 73.How Async Works: Futures, Pin & Wakers

Memory Management

Ownership-based memory management, allocation, and the memory model.

  1. 74.Memory Without a Garbage Collector
  2. 75.Allocators & Measuring Memory
  3. 76.The Rust Memory Model
  4. 77.Aliasing & Undefined Behavior

Advanced Rust

Macros, unsafe code, and performance.

  1. 78.Advanced Lifetimes
  2. 79.Declarative Macros
  3. 80.Procedural Macros
  4. 81.Unsafe Rust & FFI
  5. 82.no_std: core and alloc
  6. 83.Performance
  7. 84.API Design Idioms

Under the Hood

The compiler and the runtime: how Rust code is compiled and run.

  1. 85.How the Rust Compiler Works
  2. 86.The Runtime & Async Executors

Production Rust

Panics, async pitfalls, testing, builds, and the supply chain.

  1. 87.Panics & Failure Handling
  2. 88.Async Pitfalls in Production
  3. 89.Testing, Fuzzing & Benchmarking
  4. 90.Compile Times & Build Engineering
  5. 91.Dependencies, Security & CI
  6. 92.Debugging & Profiling in Production
  7. 93.Observability
  8. 94.Architecting Rust Services