Learn · Rust · On your machine
Own It: Hands-On Mastery of Rust
Go from your first Rust program to designing, building, reviewing and defending real Rust software: libraries, services, concurrent and unsafe code, bindings to C, and tools. The whole course is one Git repository. You write the code, tests on your machine check it, and model solutions come with it.
Free and open. No signup to read or clone it. Codespaces runs on your own GitHub account and its free monthly allowance. To keep your work, make your own copy first (see Quickstart).
- Chapters
- 24
- Lessons
- 183
- Compiler drills
- 339
- Checkpoints
- 4
- Mastery modules
- 11
- Capstones
- 7
Counted from the repository's starter files. Lessons are the core chapters' lessons, not counting each chapter's capstone.
What makes it different
Recognising Rust when you read it is not the same as writing it under pressure. The course is built on the techniques that make skills last: predicting before you see the answer, retrieving from memory, immediate feedback, explaining in writing, and reviewing on a spaced schedule. Every lesson follows the same loop.
- ReadThe chapter's
CONCEPTS.md, written for this course: the mental model, a worked example different from the exercise, and the mistakes people really make, with the compiler's real message. - PredictEach lesson ends with a predictions test. Replace every
guess()with what you think the code produces, before you run anything. A wrong guess is the most useful result you can get. - ImplementFill in the
todo!()bodies from their written contracts and run only that lesson's tests. - Check your techniqueSome tests count heap allocations, compare pointers or count threads, so a solution that clones everything or runs sequentially fails even when its output is right. Then make clippy quiet.
- Drill the compiler
cargo drillshows short programs. Predict whether each compiles, with which error code, or panics; see the verdict; then fix it. - ExplainAnswer the lesson's prompt in your
NOTES.md, add a test for an edge case, and compare with the model explanation. - Review on a scheduleWhen a chapter passes,
cargo progressschedules five short, different reviews: the first a day later, then 3, 7, 21 and 60 days after each previous one.
Tests on your machine
Every exercise is checked by tests you run locally with Cargo. A built-in coach,
cargo progress, shows what passes, what is next and which reviews are due. No account and no server needed.Solutions included
Model solutions ship in
solutions/, mirroring the repository. Each one keeps the starter's tests unchanged and passes them in debug and release builds, checked by the course's CI. Attempt first; use the hints before the solution.Review like a professional
From Chapter 2 on, every chapter has a code review of a teammate's code that compiles but has bugs and smells. From Chapter 4, a review lesson mixes earlier chapters into new problems, done from memory.
The path
The core path is 24 chapters in five parts, with four closed-notes checkpoints along the way. Beside it run a project you grow across the chapters and a track of production crates. After the core come eleven mastery modules and seven capstone projects, the last of which is the final assessment. Times are estimates for a careful first pass; sessions of 45 to 60 minutes work well.
Part 0On-rampabout 15 h
- 01Start here~4.5 hThe tools, reading test failures and compiler errors, the lesson loop.
- 02A first tour~10 hThe whole everyday language once: types, functions, loops, text, vectors, structs, enums,
match,Option,Result, tests.
Part 1Foundationsabout 53 to 62 h
- 03Numbers, text and arrays~11 hIntegers, overflow, floats, conversions, arrays, slices, text and Unicode.
- 04Ownership and moves7–8 hOwners, moves, copies, clones,
RcandArc. - 05Borrowing with references9–11 hBorrowing, lifetimes, shared versus exclusive access.
- 06Expressions and control flow9–11 hBlocks, branches,
let else, loops, casts, temporaries. - 07Handling errors8–10 hPanics,
Result,?, error types,mainand exit codes. - CP1Checkpoint 1: splitpot≤ 4 hFrom a specification, closed notes.
- 08Modules, crates and Cargo9–11 hPackages, modules, visibility, tests, features, a checked workspace lab.
Part 2Types and abstractionabout 60 to 67 h
- 09Structs and methods12–13 hMethods, generics, derives,
Cell,RefCell,Weakparent links. - 10Enums and pattern matching~8 hData-carrying enums, recursive types, every kind of pattern.
- 11Generic code with traits~9 hTraits, bounds,
dynversus generics, associated items. - CP2Checkpoint 2: postage≤ 4 hFrom a specification, closed notes.
- 12Operators for your own types5–6 hArithmetic, equality, ordering, indexing, and their contracts.
- 13Everyday traits8–9 h
Drop,Clone,Deref,AsRef,Borrow, conversions,Cow. - 14Closures and captures7–9 hCaptures,
Fn/FnMut/FnOnce, returning and storing closures. - 15Iterators and adapters11–13 hAdapters, laziness, consumers, writing your own iterators.
Part 3Data, text, I/O and concurrencyabout 55 to 61 h
- 16Standard collections10–11 h
Vec,VecDeque, heaps, maps, sets, hashing. - CP3Checkpoint 3: matchday≤ 4 hFrom a specification, closed notes.
- 17Working with text10–11 hUTF-8, editing, searching, parsing, formatting, a regex lab.
- 18Files, streams and processes10–12 h
Read,Write, buffering, binary data, paths, TCP, child processes. - 19Threads and shared state~10 hScoped threads, channels, locks, condition variables, atomics, orderings.
- 20Writing async code7–8 hFutures, borrowing across
.await, async traits and closures, cancellation. - 21Futures by hand8–9 h
poll, wakers, an executor, a reactor pattern, pinning. - CP4Checkpoint 4: seal≤ 4 hFrom a specification, closed notes.
Part 4Macros, unsafe code and FFIabout 28 to 31 h
- 22Writing macros9–10 h
macro_rules!, repetition, fragments, recursion, exporting, tt-munchers. - 23Unsafe Rust11–12 hRaw pointers, safe interfaces over unsafe code,
UnsafeCell, layout, Miri. - 24Calling C8–9 h
repr(C), C strings, callbacks, handles, calling the real C library.
AlongsideThe running project and the ecosystem trackabout 68 to 94 h
- LLloglens, the running project35–50 hOne real command-line log analyser, built in 15 milestones that follow their chapters: zero-copy parsing, error types, a filter language compiled to closures, iterator pipelines, streaming I/O, parallel files, macros. Later milestones rewrite earlier code while the earlier tests keep you safe. Standard library only.
- EEcosystem track33–44 hNine lessons on the crates and tools professional Rust uses almost everywhere: thiserror and anyhow, serde, clap, tracing, proptest, tokio, a job runner, a tooling workday, and an HTTP service with axum and reqwest. Each ends with judgement: why this crate, and when you would choose differently.
MasteryEleven mastery modulesin any order prerequisites allow
- M1The type system in depth~20 hVariance, higher-ranked bounds, GATs and lending iterators,
PhantomData, sealed traits, typestate, coherence. - M2Unsafe Rust by rebuilding the standard library~40 h
Cell,RefCell,Box,Vec,Rc/Weak, a queue, a spin lock, an arena; the aliasing model; Miri. - M3Concurrency by building the primitives30–40 hMemory orderings, a one-shot channel,
Arc, a parking mutex, lock-free structures; loom. - M4An async runtime from scratch26–29 hA raw waker, tasks and
spawn, timers, a reactor, pin projection, streams,select, a chat server, then the same on tokio. - M5Procedural macros~17 hDerives, attribute and function-like macros,
synandquote, error spans, compile-fail tests, a#[derive(Builder)]. - M6FFI across a real language boundary~27 hA build script that compiles C, hand-written and generated bindings, safe wrappers, callbacks, exporting Rust to C.
- M7Performance engineering22–25 hBenchmark design, profiles, allocation budgets, data layout, bounds checks, dispatch costs; tests that count work instead of reading clocks.
- M8Library design, semver and stewardship~18 hBreaking changes, trait and auto-trait promises, future-proofing, library errors, features, docs, MSRV.
- M9The professional toolbox32–35 hCargo in depth, lints as policy, testing at scale, fuzzing, debugging, documentation, supply chain, CI and release.
- M10Working in real codebases and contributing26–28 hOrienting in a strange project, reproducing bugs,
git bisect, code review, soundness reports, contributing to the Rust project. - M11Rust as a service45–50 hAn HTTP API on axum and tower, SQL with sqlx, authentication, CPU work beside async I/O, a binary protocol, observability.
CapstonesSeven blank-file projectsyou design every type yourself
- C1Tansy, an interpreter30–50 hA scripting language with a REPL: lexer, parser, tree-walking evaluator, closures, diagnostics.
- C2kvstore25–45 hA key-value server that survives crashes: checksummed log, recovery, compaction, a TCP protocol, graceful shutdown.
- C3httpd25–40 hAn HTTP/1.1 file server with its own thread pool, limits and a JSON endpoint, standard library only.
- C4nostd collections20–30 h
ArrayVec,RingBufferand an arena for#![no_std]programs, checked with Miri. - C5Underkiln, a graphical game40–70 hA real-time 2D game with its own rasteriser, fixed-timestep loop, collisions, replays and a headless mode.
- C6A kernel for QEMU
virt40–60 hA bare-metal Arm kernel: boot, serial port, memory, interrupts, tasks, message passing. - FinalFinal assessment: rgx35–60 hA regular-expression engine with guaranteed linear-time matching, and a parallel, deterministic grep-like tool. No hints, no concepts text, no dependencies.
The five core parts add up to about 210 to 235 hours, plus up to 16 hours for the checkpoints. You do not need every capstone: a good plan is two that match your work, then the final assessment.
How you know you have mastered it
Passing tests is necessary, not sufficient. The course gives you three increasingly demanding pieces of evidence.
- The core path. Every chapter's tests pass in debug and release builds, clippy is quiet, your notes explain every lesson in your own words, and you have done all five spaced reviews.
- Four checkpoints at "proficient". Four programs built from a specification alone, within four hours each, with closed notes.
- The final assessment at "mastery". A non-trivial engine and tool with no hints, graded against a rubric in which every cell can be checked by a command, by reading your code, or by a small experiment.
The grades are self-assessed, so they are only as honest as you are, and no course can certify you. Apply the rubrics strictly, or ask an experienced Rust programmer to apply them to your work.
Who it is for
New to Rust
You have written some code in another language: variables, functions,
ifand loops. That is all Chapter 1 assumes. You want to become fluent, not just able to read Rust.Rust users who want the why
You can make code compile, but want to know why it compiles, and to write libraries, unsafe abstractions, async services and FFI with confidence.
Teams
You want a shared, tested path for onboarding. Guides for people coming from C and C++, Go, Python, Java and C#, and JavaScript and TypeScript say which chapters deserve the most time.
Quickstart
Start with your own copy: on the GitHub page, click Use this template, so your work is saved in a repository that belongs to you. Then pick one of three setups. All three give you the same tools and the same results.
Recommended
1 · A dev container
Docker (or a free alternative) and VS Code with the Dev Containers extension. Every tool is ready, nothing is installed on your computer itself, and it works offline after the first start, which can take ten minutes or more.
Nothing to install
2 · GitHub Codespaces
The same container on a GitHub computer, with VS Code in your browser. On a free account that is about 30 hours of work a month for this course. Commit and push every session: an unused codespace is deleted after 30 days.
Your own setup
3 · Install the tools
Git and rustup. The repository pins its toolchain, which rustup installs the first time you run Cargo there. A few units need extras, such as a C compiler, QEMU or a nightly toolchain with Miri.
Then open a terminal. On your own machine, clone first. In a dev container or a codespace the course is already open, so skip the first two lines and start at cargo progress doctor.
$ git clone https://github.com/Indicogni/own-it-rust.git
$ cd own-it-rust
$ cargo progress doctor # checks Rust 1.99.0, clippy and rustfmt
$ cargo progress # run once before you edit anything
$ cargo test --test chapter01 l01_
If you made your own copy, clone its URL instead. The last command runs Chapter 1, lesson 01: four tests fail. That is the correct starting state, not a broken setup. Then open exercises/chapter01/README.md.
What you need
A computer, or just a browser
Linux, macOS or Windows. Or only a web browser and a free GitHub account with Codespaces. For a dev container, allow it at least 4 CPUs and 8 GB of memory; less works, but builds are slow.
A few gigabytes of disk
The pinned toolchain takes under 1 GB, and a debug build of all chapters about 0.5 GB. Some mastery modules and capstones download crates and need more; their READMEs say so.
Time
About 210 to 235 hours for the 24 core chapters on a careful first pass, then as much of the project, ecosystem track, mastery modules and capstones as your work calls for.
The course has been verified on macOS on Apple silicon. Its CI also runs every check on Linux and Windows; treat those platforms as verified once that workflow is green for the version you cloned. The core chapters use only the standard library and need no network after the toolchain is installed.
FAQ
Is it free?
Yes. The course, its tests and its model solutions are free in a public GitHub repository, with no account needed to read or clone it. Codespaces is optional and runs on your own GitHub account; a free account's monthly allowance covers about 30 hours of work a month for this course, and without a payment method GitHub does not charge you.
What is the licence?
Two licences. The code (every source and configuration file, and every code block in the Markdown, except text diagrams) is under the MIT License: use it, change it and redistribute it, also commercially, keeping the copyright notice. The prose and figures are under Creative Commons Attribution-NonCommercial-ShareAlike 4.0: share and adapt them for non-commercial use, with credit and under the same licence. NOTICE.md explains the split; the licence texts are what apply.
Does it run in my browser, like the labs of other indicogni courses?
No. This course runs locally: you write real Rust and run real Cargo tests on a real machine, either your own or a GitHub Codespace, which gives you VS Code in your browser on a GitHub computer. There is nothing to run on this page.
Does it work on Windows?
It is built to, in two ways. Install Rust with rustup and use the MSVC toolchain (the units that compile C need the Visual Studio Build Tools, which that toolchain needs anyway), or use the dev container with Docker Desktop on WSL 2. The course has been verified on macOS; its CI runs every check on Windows and Linux too, so treat Windows as verified once that workflow is green for the version you cloned. The Docker labs of two mastery modules (M9 and M11) run on your own computer, outside the container.
Do I need to know Rust already?
No. Chapter 1 assumes only that you have written a little code in some language, and it teaches the tools, how to read test failures and compiler errors, and the lesson loop itself. If you already know Rust, the guides and each chapter's README help you decide where to spend time.
Can I just read the solutions?
You can; they are all there. But a solution you only read is forgotten within days, and one you struggled with first stays. Use the hints first. For the checkpoints and the final assessment, read the solution only after you have graded your own work against the rubric.
Do I get a certificate?
No. The rubrics are self-assessed and written so each cell can be checked. No course can certify you; your passing tests, notes and capstones are the evidence.
I found a mistake. Where do I report it?
Corrections are very welcome. Open an issue in the course repository; CONTRIBUTING.md lists what to include. Pull requests cannot be merged until a contributor agreement is published, so please describe the correction in the issue. You can also write to feedback@indicogni.com.
Disclaimer
This course is educational material, provided "as is", without warranty of any kind, express or implied. The terms of the MIT License (code) and of CC BY-NC-SA 4.0 (prose and figures) apply, including their disclaimers of warranty and limitations of liability. You use the course at your own risk.
- Some exercises run unsafe code, low-level and bare-metal kernel labs, local network servers, Docker labs and C code. A mistake in them can crash a program or misbehave in other ways. Read what you run before you run it, and prefer the dev container or a codespace, which keep most of that work apart from the rest of your system.
- Lab servers are for your own machine. Do not expose them to the internet or run them on networks you do not control.
- The course downloads third-party crates and tools (Rust, Cargo, crates.io packages, container images, QEMU and others). They come from their own authors, keep their own licences and terms, and are not covered by the course's licences.
- This is an independent course. It is not affiliated with or endorsed by the Rust Foundation or any publisher. "Rust" and the Rust logo are trademarks of the Rust Foundation, used here only to refer to the programming language.