Skip to content
Select theme

All Rust chapters

Eight books, thirty-five chapters, and every article in them answers one question, so you can open the one that matches what just broke, read it, and go back to your editor. Nothing here has to be read in order — the books are groups, not a syllabus. If you would rather build something instead, the project tracks are the other half.

The least reference-like part of the site: whether Rust is worth your time, and the handful of things that confuse everyone in their first week.

Chapter Articles What is in it
Should you learn Rust? 4 Whether it is worth it, how long it takes, what people ship with it, and how to try Rust without installing anything
The bits that trip everyone up 8 mut, shadowing, const versus static, the missing semicolon, ranges — the first week, explained rather than prescribed

Where the borrow checker lives, and the reason Rust is hard before it is pleasant.

Chapter Articles What is in it
Moves and ownership 20 One owner per value, what a move actually does, and when cloning is the right answer rather than the lazy one
Borrowing 12 & and &mut, how long a borrow really lasts, and how to end one early
Lifetimes 15 What a lifetime annotation is saying, the elision rules, and when 'static is the wrong answer
Smart pointers and sharing 18 Box, Rc, Arc, Cow, Deref, why memory grows, and when a value is actually on the heap
Interior mutability 6 Cell and RefCell, borrow checking that happens at runtime, and fixing BorrowMutError

The work: text, files, arguments, JSON, dates, the network. This is the half of the site you arrive at from a search engine with a specific problem.

Chapter Articles What is in it
Working with text 19 Building, splitting, formatting and searching strings, UTF-8, regex, templates, aligning a table
Working with collections 23 Sorting, deduplicating and searching a Vec, HashMap’s entry API, and picking the right collection
Reading and writing files 20 Reading, writing, atomic writes, paths, walking directories, temporary files, watching for changes, archives, images
Building a command-line tool 16 Arguments and subcommands with clap, stdin, exit codes, colour, progress bars, configuration, end-to-end tests, shipping a binary
Working with JSON, TOML and CSV 11 serde in both directions, renamed fields, missing fields, enum representations, YAML, query strings
Working with numbers 12 String and number conversions, overflow, float comparison and rounding, thousands separators, division and remainder
Working with dates and time 5 The current time, measuring a duration, timestamps, time zones, and chrono’s sharp edges
Talking to the network 12 reqwest GET and POST, timeouts, retries, concurrent requests, parsing an API’s JSON, downloads, URLs, TLS
Processes, environment and signals 8 Environment variables, running other programs, pipes, timeouts, Ctrl+C, scheduled work
Logging and configuration 7 tracing, RUST_LOG, structured fields, which config wins, and keeping secrets out of logs
Talking to a database 10 SQLx against Postgres, migrations, compile-time-checked queries, transactions, SQLite, injection, testing

Types, traits and generics — 75 articles

Section titled “Types, traits and generics — 75 articles”

Modelling your own problem in Rust, and the abstraction tools that come with it.

Chapter Articles What is in it
Structs, enums and pattern matching 26 Your own types, derive, match and destructuring, From and Display, builders, newtypes
Traits 18 What a trait is, the orphan rule, associated types, and the ones you have to know: Drop, Clone, Copy, Send, Sync
Generics and dynamic dispatch 8 Generic parameters, impl Trait, dyn Trait, static dispatch versus a vtable, where clauses
Closures and iterators 23 Captures and move, the Fn family, map / filter / collect, laziness, writing your own iterator

Errors, testing and tooling — 122 articles

Section titled “Errors, testing and tooling — 122 articles”

What to do when the compiler is right, and how to keep a project from rotting.

Chapter Articles What is in it
Handling errors 27 ?, the Option and Result combinators, thiserror versus anyhow, and where a panic belongs
Compiler errors 36 How to read a compiler message, then one E-code per article with the real output, and what it means for your code
Testing your code 14 Unit and integration tests, doctests, proptest, criterion, and how to test the path you hope never runs
Cargo and project layout 31 Crates and modules, visibility, dependencies and features, workspaces, publishing, editions
Debugging, docs and tooling 14 dbg!, backtraces, a debugger, clippy, rustfmt, compile times, documentation, CI

Two ways to do more than one thing at once, and the errors each one produces.

Chapter Articles What is in it
Threads 9 spawn and join, move, Arc, Send and Sync, scoped threads, recovering from a panic
Sharing state between threads 10 Channels, Mutex and RwLock, deadlocks, atomics, and the ways to need no lock at all
Async fundamentals 11 What async is, futures and executors, join!, timeouts, cancellation, Stream
Async in practice 12 Runtime configuration, select!, spawn, the error you get holding a lock across an await, spawn_blocking, graceful shutdown

The escape hatches. Read them when you have to, not before.

Chapter Articles What is in it
Unsafe Rust and FFI 10 Raw pointers, the edges of unsafe, the undefined-behaviour checklist, MaybeUninit, calling C, exporting to C, bindgen
Macros 7 macro_rules!, proc macros, derive macros, and when not to reach for one

Rust compared, and what next — 19 articles

Section titled “Rust compared, and what next — 19 articles”

Rust next to what you already know, and what to do once it stops fighting you.

Chapter Articles What is in it
Rust vs other languages 9 Rust next to C++, Go, Python, JavaScript and Java, and what to watch for coming from each
What to learn next 10 Whether to learn it, where it is used in production, the job market, and where to go from here

Series rather than answers: each one ends with something that runs. They are longer, and they assume the chapters above rather than repeating them.

Track Articles What you end up with
Build a CLI tool 12 hit, a command-line HTTP client with a config file
Write a toy database 12 tinylsm, a persistent LSM key-value store, standard library only
A production API with Axum and SQLx 15 A short-link API with auth, migrations, logging, integration tests and Docker
A desktop app with Tauri 12 A local Markdown notes app: React, SQLite, full-text search
Speed up React with WebAssembly 8 Replace a slow JavaScript function with Rust, benchmark included
Embedded Rust on STM32 10 From a blinking LED to an I2C sensor, async tasks and low power
Write your own search engine 12 An inverted index, tokenising, BM25, and an HTTP query endpoint
Build a terminal UI with Ratatui 8 A log and process monitor, in the terminal
Build a Redis clone 10 The RESP protocol, concurrent connections, persistence
Write an interpreter 10 Lexer to syntax tree to evaluator — a scripting language that runs
LLM apps in Rust 8 Local inference, vector search, and a RAG service
Rust vs Go 6 Performance, concurrency, error handling, deployment, hiring, and a table you can argue with

Most readers arrive at Ownership, because that is where the borrow checker lives. If Rust is not installed yet, rustup.rs is the official one-command installer — this site does not repeat it. After that, jump to whatever the compiler said.

Search covers every chapter: press Ctrl+K or ⌘+K.