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

Course Structure

This page is for the course instructor.

Rust Fundamentals

The first four days make up Rust Fundamentals. The days are fast-paced and we cover a broad range of topics!

Course schedule:

  • Day 1 Morning (2 hours and 10 minutes, including breaks)
SegmentDuration
Welcome5 ๅˆ†้˜
Hello, World15 ๅˆ†้˜
Types and Values40 ๅˆ†้˜
Control Flow Basics45 ๅˆ†้˜
  • Day 1 Afternoon (2 hours and 45 minutes, including breaks)
SegmentDuration
ๅ€ผ็ต„่ˆ‡้™ฃๅˆ—35 ๅˆ†้˜
References55 ๅˆ†้˜
User-Defined Types1 hour
  • Day 2 Morning (2 hours and 50 minutes, including breaks)
SegmentDuration
Welcome3 ๅˆ†้˜
Pattern Matching50 ๅˆ†้˜
Methods and Traits45 ๅˆ†้˜
Generics50 ๅˆ†้˜
  • Day 2 Afternoon (2 hours and 50 minutes, including breaks)
SegmentDuration
Closures30 ๅˆ†้˜
Standard Library Types1 hour
Standard Library Traits1 hour
  • Day 3 Morning (2 hours and 20 minutes, including breaks)
SegmentDuration
Welcome3 ๅˆ†้˜
่จ˜ๆ†ถ้ซ”็ฎก็†1 hour
Smart Pointers55 ๅˆ†้˜
  • Day 3 Afternoon (2 hours and 30 minutes, including breaks)
SegmentDuration
ๅ€Ÿ็”จ1 ๅฐๆ™‚ๅˆ 15 ๅˆ†้˜
Lifetimes1 ๅฐๆ™‚ๅˆ 5 ๅˆ†้˜
  • Day 4 Morning (2 hours and 50 minutes, including breaks)
SegmentDuration
Welcome3 ๅˆ†้˜
Iterators55 ๅˆ†้˜
Modules45 ๅˆ†้˜
Testing45 ๅˆ†้˜
  • Day 4 Afternoon (2 hours and 20 minutes, including breaks)
SegmentDuration
้Œฏ่ชค่™•็†55 ๅˆ†้˜
Unsafe Rust1 ๅฐๆ™‚ๅˆ 15 ๅˆ†้˜

Deep Dives

In addition to the 4-day class on Rust Fundamentals, we cover some more specialized topics:

Rust in Android

The Rust in Android deep dive is a half-day course on using Rust for Android platform development. This includes interoperability with C, C++, and Java.

You will need an AOSP checkout. Make a checkout of the course repository on the same machine and move the src/android/ directory into the root of your AOSP checkout. This will ensure that the Android build system sees the Android.bp files in src/android/.

Ensure that adb sync works with your emulator or real device and pre-build all Android examples using src/android/build_all.sh. Read the script to see the commands it runs and make sure they work when you run them by hand.

Rust in Chromium

The Rust in Chromium deep dive is a half-day course on using Rust as part of the Chromium browser. It includes using Rust in Chromiumโ€™s gn build system, bringing in third-party libraries (โ€œcratesโ€) and C++ interoperability.

You will need to be able to build Chromium โ€” a debug, component build is recommended for speed but any build will work. Ensure that you can run the Chromium browser that youโ€™ve built.

Bare-Metal Rust

The Bare-Metal Rust deep dive is a full day class on using Rust for bare-metal (embedded) development. Both microcontrollers and application processors are covered.

For the microcontroller part, you will need to buy the BBC micro:bit v2 development board ahead of time. Everybody will need to install a number of packages as described on the welcome page.

Concurrency in Rust

The Concurrency in Rust deep dive is a full day class on classical as well as async/await concurrency.

You will need a fresh crate set up and the dependencies downloaded and ready to go. You can then copy/paste the examples into src/main.rs to experiment with them:

cargo init concurrency
cd concurrency
cargo add tokio --features full
cargo run

Course schedule:

  • Morning (3 hours and 20 minutes, including breaks)
SegmentDuration
Threads30 ๅˆ†้˜
Channels20 ๅˆ†้˜
Send and Sync15 ๅˆ†้˜
Shared State30 ๅˆ†้˜
Exercises1 ๅฐๆ™‚ๅˆ 10 ๅˆ†้˜
  • Afternoon (3 hours and 30 minutes, including breaks)
SegmentDuration
Async Basics40 ๅˆ†้˜
Channels and Control Flow20 ๅˆ†้˜
Pitfalls55 ๅˆ†้˜
Exercises1 ๅฐๆ™‚ๅˆ 10 ๅˆ†้˜

Idiomatic Rust

The Idiomatic Rust deep dive is a 2-day class on Rust idioms and patterns.

You should be familiar with the material in Rust Fundamentals before starting this course.

Course schedule:

  • Morning (14 hours and 25 minutes, including breaks)
SegmentDuration
Foundations of API Design3 ๅฐๆ™‚ๅˆ 30 ๅˆ†้˜
Leveraging the Type System7 ๅฐๆ™‚ๅˆ 30 ๅˆ†้˜
Polymorphism3 ๅฐๆ™‚ๅˆ 5 ๅˆ†้˜

Unsafe (Work in Progress)

The Unsafe deep dive is a two-day class on the unsafe Rust language. It covers the fundamentals of Rustโ€™s safety guarantees, the motivation for unsafe, review process for unsafe code, FFI basics, and building data structures that the borrow checker would normally reject.

not found - {{%course outline Unsafe}}

Format

The course is meant to be very interactive and we recommend letting the questions drive the exploration of Rust!