Choose a focused Rust syntax path, then practice snippets in order.
Rust Basics beginner Master the fundamentals: defining structs, implementing methods, and basic enums.
structimplenumpub fn
5 snippets View pack →
Option / Result intermediate Learn safe error handling and null-safety without exceptions.
Option<Result<Some(None+4
7 snippets View pack →
Enum / Match beginner Leverage algebraic data types and exhaustive pattern matching.
enummatch=>Some(+3
10 snippets View pack →
Borrowing intermediate Understand ownership, references, mutable borrows, and basic lifetimes.
&self&mut&mut self
3 snippets View pack →
Lifetimes advanced Annotate how long references stay valid, starting from the classic longest.
'static&mutwhere
6 snippets View pack →
Collections beginner Practice using standard library vectors and hashmaps.
Vec<vec![HashMap.iter()+1
2 snippets View pack →
Iterator Chains intermediate The adapter chains that replace hand-written loops.
.iter().map(.filter(.collect()+1
10 snippets View pack →
Traits intermediate Define shared behaviour, from a bare trait to dyn dispatch.
traitimpldyn where+1
10 snippets View pack →
Generics advanced One implementation, many types, with bounds that keep it honest.
whereimplVec<HashMap
6 snippets View pack →
Error Handling advanced Question marks, custom error enums, and From conversions.
?;Result<Err(.map_err(+1
8 snippets View pack →
Closures intermediate Capture, move, and pass behaviour around.
implwhere.map(let mut
6 snippets View pack →
Smart Pointers advanced Box, Rc, RefCell, Arc and the traits behind them.
Box<Rc<Arc<Option<
7 snippets View pack →
Strings beginner String versus &str, and the conversions between them.
.to_string().as_str().collect()match
7 snippets View pack →
Async Rust advanced async fn, await, spawning, and awaiting with a timeout.
async fn.awaitResult<while let
7 snippets View pack →
Modules & Tests intermediate Organise code and write the test module that ships beside it.
pub fnimpl#[derive(
5 snippets View pack →
DSA Rust advanced Apply Rust syntax to classic Data Structures and Algorithms.
whilelet mutOption<HashSet+1
5 snippets View pack →
DSA Advanced advanced Dynamic programming, heaps, graphs, and pointer surgery.
Option<Box<HashMapwhile let+1
12 snippets View pack →