Learn Rust through interactive exercises that let you practice each concept as you go.
Variables
Variables let you store a value and give it a name so you can use it in your code.
Numbers
Rust has separate types for whole numbers and decimals, and each one has a fixed size.
Chars & Bools
A char holds a single character and a bool holds true or false.
Statements & Expressions
Expressions return a value and statements do not. This difference shapes how Rust reads your code.
Functions
A function takes inputs, runs code, and hands a value back. Return types, diverging functions, and match.
Ownership
Every value has exactly one owner. Learn how move, clone, and copy control who holds a value.
Borrowing
Borrowing lets you use a value without taking ownership. Learn references, the borrow checker, and lifetimes.
String vs &str
Rust has two string types. String owns its data and can grow. &str is a borrowed slice used for reading.
Slices
A slice is a borrowed view into part of a collection. Work with arrays and strings without copying data.
Tuples
A tuple groups values of different types. Learn indexing, destructuring, and nested tuples.
Structs
A struct is a custom type that groups named fields. Learn methods, field shorthand, and struct update syntax.
Enums
An enum represents one of several named variants. Learn how to store data inside variants and model state.
Option
Option is how Rust handles values that might not exist. Use Some and None instead of null.