Fundamentals
-
Conditional Logic
Using if, else, and else if expressions in Rust to control program flow, including conditional variable assignment.
-
The Result Type
How Rust handles recoverable errors with the Result type, including pattern matching, the ? operator, and common methods like map_err and unwrap_or.
-
Compound Data Types
How to create and access tuples and arrays in Rust, with indexing, destructuring, and when to use each.
-
Organizing Code: Crates, Packages, and Modules
How Rust programs are organized with crates, packages, and modules, including file structure, visibility, paths, and the use keyword.
-
Pattern Matching with `match`
How to use Rust's match expression for exhaustive pattern matching, including enums with data, the wildcard pattern, if let, and Option.
-
Functions
Declaring functions in Rust, with parameters, return values, and the difference between statements and expressions.
-
The Enum Type
How to define and use enums in Rust, including variants with data and an introduction to pattern matching with match.
-
The Struct Type
How to define, instantiate, and use structs in Rust, including update syntax, field init shorthand, and tuple structs.
-
Loops
Rust's three loop types: loop, while, and for, including returning values from loops and using ranges.
-
Variables, Mutability, and Shadowing
How variables work in Rust, why they're immutable by default, and how shadowing lets you transform values.
-
Methods and Associated Functions
How to add behavior to structs in Rust with methods and associated functions using impl blocks.
-
Setting Up Rust and Your First Program
Install Rust, create your first project with Cargo, and run a hello world program step by step.
-
The Option Type
How Rust uses the Option type instead of null values, with pattern matching, if let, and common methods like unwrap, map, and unwrap_or.
-
Ownership and Borrowing
How Rust manages memory through ownership, moving, copying, cloning, borrowing, and references, with the rules that make your programs safe without a garbage collector.
-
A Greeting Program
Build a small Rust program that takes user input from the terminal and constructs a greeting, using functions for separation of concerns.
-
Programming Shapes: A Pattern Library
Four repeating patterns that cover most programming problems, no matter how different they look on the surface.
-
Comments
How to use regular comments and documentation comments in Rust, and why commenting your code matters.
-
Constants
How to declare and use constants in Rust to replace magic values in your code.
-
Scalar Data Types
Rust's scalar types: integers, floating-point numbers, booleans, and characters.