Outline updated November 2026
Mastering Rust
Class Duration
35 hours of live training delivered over 5-10 days to accommodate your scheduling needs.
Student Prerequisites
- Professional software development experience in any modern language
- Comfort with the command line
- No prior Rust experience required
Target Audience
Software engineers new to Rust who will write libraries and services that other people depend on, including async services, C integrations, and procedural macros. For a shorter start, Rust Essentials covers the first part of this course in 21 hours. Teams continuing on can move to Memory-Safe Programming with Rust and Rust Parallel Programming.
Description
Mastering Rust takes developers new to the language from their first program to advanced Rust in one course. The first part covers the Rust Essentials material: Cargo, types, ownership, lifetimes, pattern matching, and error handling. The course then moves through traits and generics, async, concurrency, unsafe, FFI, and macros. It ends with Cargo builds, editions, testing, and agentic development. Students use AI coding assistants on Rust code and check the results with the compiler, clippy, and tests.
Learning Outcomes
- Build CLI applications and library crates with Cargo.
- Write idiomatic Rust using ownership, borrowing, and lifetimes.
- Model data with structs, enums, and pattern matching.
- Handle errors with
Result<T, E>and the?operator. - Design APIs with traits, generics, and lifetimes.
- Build async services on Tokio with structured cancellation.
- Share data across threads with
Arc,Mutex, channels, and atomics. - Write
unsafecode behind safe abstractions. - Wrap C libraries in safe Rust APIs.
- Write declarative macros and procedural derive macros.
- Write tested and documented Rust libraries.
- Review AI-generated Rust with the compiler, clippy, and tests.
- Set up CI that catches regressions before merge.
Training Materials
All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples.
Software Requirements
A free GitHub account, the current stable Rust toolchain via rustup (2024 edition), Visual Studio Code or another supported editor with the rust-analyzer extension, Docker for the FFI examples, and an AI coding assistant of choice (GitHub Copilot, Cursor, or Claude Code). A cloud-based environment can be provided if local installation is restricted.
Training Topics
Introduction to Modern Rust
- What Rust is and where it fits
- What the current edition changed
- Working with the borrow checker
- The crates.io ecosystem
- The Rust Playground
Toolchain and Editor Setup
- Installing Rust with
rustup - Managing toolchains
cargo,rustc,rustfmt, andclippy- rust-analyzer in VS Code, RustRover, and Zed
- Debugging with CodeLLDB
- AI assistants for Rust
- A daily Rust workflow
Hello, Cargo
- Creating a project with
cargo new mainandprintln!cargo runandcargo build- Release builds
- Managing dependencies in
Cargo.toml - Workspaces and
cargo publish --workspace
Scalar Types and Variables
- Integers, floats, booleans, and characters
- Constants and statics
- Immutability and
mut - Shadowing and scope
- Overflow in debug vs. release
Control Flow
- Expressions vs. statements
ifandelseloop,break, and labeled loopswhileandforloopsletchains inifandwhile- Block expressions
Functions and Closures
- Defining and calling functions
- Parameter and return types
- Closures and capture modes
- Function pointers vs. closures
- Spotting hallucinated signatures from AI
Modules and Crates
modanduse- The standard library
- Third-party crates from crates.io
- Re-exports and visibility
Built-In Macros
print!,println!,eprintln!, andformat!vec!,dbg!, andassert!include_str!andinclude_bytes!cfg!,env!, andpanic!
Memory Management and Ownership
- Manual memory management vs. garbage collection
- Ownership and moves
Copyvs.Clone- Borrowing with
&Tand&mut T - Lifetimes and the borrow checker
- Lifetime elision and annotations
- Reading borrow-checker errors
- Common ownership patterns
Strings and String Slices
Stringvs.&str- UTF-8 and character boundaries
- Parsing, trimming, splitting, and joining
- String formatting
Tuples, Enums, and Structs
- Tuples and tuple structs
- Enums with data
Option<T>andResult<T, E>- Structs and methods
- Associated functions and constructors
- The newtype pattern
Collections and Iterators
- Creating and indexing
Vec<T> - Slicing and iteration
iter,iter_mut, andinto_iterHashMapandHashSetBTreeMapandBTreeSet- Borrowing rules for collections
- Iterator combinators
- Custom iterators
Pattern Matching
matchand exhaustivenessif letandwhile let- Destructuring structs, tuples, and enums
- Nested patterns
- Guards, bindings, and
@patterns - Refutable vs. irrefutable patterns
Idiomatic Error Handling
Result<T, E>and the?operator- Custom error enums with
thiserror - Application errors with
anyhow - Avoiding
unwrapin library code - When to panic
AI-Assisted Rust Development
- rust-analyzer and AI as a feedback loop
- The compiler and clippy as the check
- Prompts for ownership and lifetimes
- Reviewing AI-generated
unwrap - A CLI feature from prompt to review
Traits and Generics
- Defining and implementing traits
- Default methods and supertraits
- Bounds,
whereclauses, and associated types - Trait objects and
dyn Trait - Trait upcasting
- Static vs. dynamic dispatch
Advanced Traits and Lifetimes
- Return-position
impl Traitin traits - RPIT lifetime capture rules
- Precise capturing with
use<..> - Higher-ranked trait bounds
- Designing trait hierarchies
Async and Concurrency
- The async/await model
- Async fn in traits
- Async closures and the
AsyncFntraits - Tokio tasks and the scheduler
tokio::select!andJoinSet- Structured cancellation
- Streams and
futures::Stream
Concurrent Programming
Send,Sync, and data races- Threads,
Arc,Mutex, andRwLock - Channels in
std,crossbeam, andtokio - Atomics and memory ordering
rayonvs. async
Unsafe Rust
- What
unsafeallows - Raw pointers
- Safe abstractions over unsafe code
- Naked functions
- Auditing
unsafeblocks - Reviewing AI-generated
unsafe
Foreign Function Interface
extern "C"and ABIsunsafe externblocks and unsafe attributes- Calling C from Rust
- Exposing Rust to C
CStringandCStrbindgen,cbindgen, andlibc- Safe wrappers over C libraries
Macros and Metaprogramming
- Declarative macros with
macro_rules! - Fragment specifiers, repetition, and hygiene
- Derive, attribute, and function-like macros
syn,quote, andproc-macro2- Writing a custom
derivemacro
Cargo Features and Builds
- Features and profiles in
Cargo.toml - Target-specific dependencies
- Build scripts and code generation
- Reproducible builds
- Dependency hygiene
- LLD by default on x86-64 Linux
Editions and MSRV
- Editions, MSRV, and toolchains
- Temporary scope changes
- Stable features on every edition
- The MSRV-aware resolver
- Migrating with
cargo fix --edition
Testing, Documentation, and Quality
- Unit, integration, and doc tests
- Property testing with
proptest - Benchmarks with
criterion - Documentation with
rustdoc - Coverage with
cargo-llvm-cov
Agentic Rust Development
- Copilot, Cursor, Claude Code, and Codex
- Tests as gatekeepers for AI code
- Prompts for trait design
- Unbounded allocations in AI code
- MCP tools in Rust workflows
- Agent-driven refactors
- AI code review in CI
- Measuring AI's effect on a team