Rust Refresher
Class Duration
14 hours of intensive training with live instruction delivered over two to four days to accommodate varied scheduling needs
Student Prerequisites
- Software engineers with some Rust programming experience
Target Audience
Software engineers who find Rust’s memory‑management model, particularly its lifetime system, challenging, as well as those who struggle with its error‑handling patterns and data‑structure design, can benefit from a focused refresher class.
Description
This refresher equips working Rust developers with a concise, hands-on review of the language as it stands on the 2024 edition (Rust 1.85 introduced the edition; 1.95+ recommended for the current toolchain). It covers the core mental model — ownership, borrowing, lifetimes, idiomatic data modeling, pattern matching, traits and generics — and updates participants on what has changed since they last wrote Rust regularly: features stabilized since 1.85: async closures, let-chains (1.88), naked functions (1.88), the LLD default linker on Linux (1.90), native workspace publishing (1.90); plus the maturing AI-coding-tool ecosystem. (async fn in traits has been stable since 1.75.) Ideal for developers who learned Rust at some point and need to get back to production-quality output quickly.
Learning Outcomes
- Explain ownership, borrowing, and lifetimes precisely and demonstrate idiomatic Rust usage that prevents data races and dangling references.
- Construct and manipulate tuples, enums, structs, vectors, and hashmaps, applying standard patterns for each.
- Use idiomatic pattern matching (
match,if let,while let) and 2024-editionlet-chains to safely decompose and process complex data. - Write generic functions and types that are monomorphized at compile time, choosing static vs. dynamic dispatch deliberately.
- Apply async fn in traits and async closures where they fit, and recognize where they don't.
- Use AI coding assistants productively for Rust while letting the compiler, clippy, and tests be the source of truth.
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. Students practice the topics covered through challenging hands-on lab exercises.
Software Requirements
Students will need a free, personal GitHub account to access the courseware. Student will need permission to install Rust and Visual Studio Code on their computers. Also, students will need permission to install Rust Crates and Visual Studio Code Extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.
Training Topics
What's New Since You Last Wrote Rust
- Rust 2024 edition:
let-chains, async closures, RPIT capture rules, naked functions - Async fn in traits and return-position
impl Traitin traits - Toolchain improvements: LLD default linker on Linux, native
cargo publish --workspace - Editor and AI assistants: rust-analyzer + GitHub Copilot, Cursor, or Claude Code
Scalar Types and Variables
- Primitive Types: Integers, Floats, Booleans, and Characters
- Constants and Static Values
- Immutability by Default
- Mutable Bindings with
mut - Variable Shadowing
- Scope and Block Expressions
Memory Management
- Pitfalls of Manual Memory Management
- Overhead of Garbage Collection
- Rust's Ownership Model
- Move Semantics
- Borrowing and References
- Lifetime Annotations
- The Borrow Checker in Practice
Strings and String Slices
- Heap-Allocated
Stringvs Stack-Based&str - Creating and Manipulating String Slices
- Building and Modifying Owned Strings
- Converting Between
Stringand&str - Parsing Strings into Numeric Types
- Trimming, Splitting, and Joining
- String Formatting and Interpolation
Tuples
- Tuple Fundamentals and Use Cases
- Storing Heterogeneous Types
- Indexing and Accessing Elements
- Destructuring into Named Bindings
- Unit Tuples and Empty Returns
- Tuples as Lightweight Data Containers
Enums
- Defining Enums and Variants
- Variants with Associated Data
- Implementing Methods on Enums
- The
Option<T>Type for Nullable Values - The
Result<T, E>Type for Error Handling - When to Use Enums vs Structs
Structs
- Defining Named-Field Structs
- Creating and Initializing Instances
- Field Init Shorthand Syntax
- Updating Instances with Struct Update Syntax
- Tuple Structs for Positional Data
- Unit-Like Structs as Markers
- Struct Ownership and Borrowed Fields
- Implementing Methods with
impl - Associated Functions and Constructors
Vectors
- The
Vec<T>Growable Array Type - Creating Vectors with
vec!andVec::new() - Pushing, Popping, and Inserting Elements
- Safe Access with
get()vs Direct Indexing - Iterating with
iter(),iter_mut(), andinto_iter() - Slicing, Length, and Capacity Management
- Memory Layout and Reallocation Behavior
- Ownership and Borrowing with Vector Elements
Pattern Matching
- Pattern Matching Fundamentals
- The
matchExpression and Exhaustiveness - Concise Matching with
if let - Looping with
while let - Destructuring Structs, Tuples, and Enums
- Guards and Bindings in Patterns
- Ownership and Borrowing in Patterns
- Refutable vs Irrefutable Patterns
Generics and Traits
- Generic Type Parameters in Functions and Structs
- Defining and Implementing Traits
- Trait Bounds and
whereClauses - Static Dispatch via Monomorphization
- Binary Size Implications of Generics
- Dynamic Dispatch with Trait Objects (
dyn Trait) - Choosing Between Static and Dynamic Dispatch
- Async fn in traits: when to use it, when to box
Async at a Glance
- async/await refresher and Tokio runtime fundamentals
- Async closures (Rust 2024) and where they shine
- Structured concurrency with
tokio::select!andJoinSet Send/Syncand'staticbounds in async code
AI-Assisted Rust Workflow
- Using rust-analyzer + AI assistants as a tight feedback loop
- Prompts that work well for Rust ownership and lifetime questions
- Reviewing AI-generated
unsafe,unwrap, and reflexiveArc<Mutex<T>> - Where AI shines on Rust and where the compiler still has to win the argument