Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust Bootstrap Course for C/C++ Programmers

Course Overview

  • Course overview
    • The case for Rust (from both C and C++ perspectives)
    • Local installation
    • Types, functions, control flow, pattern matching
    • Modules, cargo
    • Traits, generics
    • Collections, error handling
    • Closures, memory management, lifetimes, smart pointers
    • Concurrency
    • Unsafe Rust, including Foreign Function Interface (FFI)
    • no_std and embedded Rust essentials for firmware teams
    • Case studies: real-world C++ to Rust translation patterns
  • We’ll not cover async Rust in this course — see the companion Async Rust Training for a full treatment of futures, executors, Pin, tokio, and production async patterns

Self-Study Guide

This material works both as an instructor-led course and for self-study. If you’re working through it on your own, here’s how to get the most out of it:

Pacing recommendations:

ChaptersTopicSuggested TimeCheckpoint
1–4Setup, types, control flow1 dayYou can write a CLI temperature converter
5–7Data structures, ownership1–2 daysYou can explain why let s2 = s1 invalidates s1
8–9Modules, error handling1 dayYou can create a multi-file project that propagates errors with ?
10–12Traits, generics, closures1–2 daysYou can write a generic function with trait bounds
13–14Concurrency, unsafe/FFI1 dayYou can write a thread-safe counter with Arc<Mutex<T>>
15–16Deep divesAt your own paceReference material — read when relevant
17–19Best practices & referenceAt your own paceConsult as you write real code

How to use the exercises:

  • Every chapter has hands-on exercises marked with difficulty: 🟢 Starter, 🟡 Intermediate, 🔴 Challenge
  • Always try the exercise before expanding the solution. Struggling with the borrow checker is part of learning — the compiler’s error messages are your teacher
  • If you’re stuck for more than 15 minutes, expand the solution, study it, then close it and try again from scratch
  • The Rust Playground lets you run code without a local install

When you hit a wall:

  • Read the compiler error message carefully — Rust’s errors are exceptionally helpful
  • Re-read the relevant section; concepts like ownership (ch7) often click on the second pass
  • The Rust standard library docs are excellent — search for any type or method
  • For async patterns, see the companion Async Rust Training

Table of Contents

Part I — Foundations

1. Introduction and Motivation

2. Getting Started

3. Basic Types and Variables

4. Control Flow

5. Data Structures and Collections

6. Pattern Matching and Enums

7. Ownership and Memory Management

8. Modules and Crates

9. Error Handling

10. Traits and Generics

11. Type System Advanced Features

12. Functional Programming

13. Concurrency

14. Unsafe Rust and FFI

Part II — Deep Dives

15. no_std — Rust for Bare Metal

16. Case Studies: Real-World C++ to Rust Translation

Part III — Best Practices & Reference

17. Best Practices

18. C++ → Rust Semantic Deep Dives

19. Rust Macros