A free, open-source collection of Rust exercises and examples, organized by chapter with runnable, editable code and solutions.
rust-lang/book
The official source of "The Rust Programming Language" book, built with mdBook into the free online edition.
- Stars
- 18,521
- Forks
- 4,170
- Open issues
- 483
- Last commit
- 9 days ago
What is it?
This repository holds the Markdown source for "The Rust Programming Language", the official introductory book for Rust. Running mdbook build turns the sources into a browsable HTML version, and the same text is published online for free through the stable, beta, and nightly Rust documentation channels.
The book's code listings are tested as part of the build with mdbook test, so the examples are checked against the Rust toolchain. Releases on GitHub package the code of all listings so readers can run them locally.
The project is maintained by the Rust team. Printed editions are available from No Starch Press, and larger revisions are timed to coincide with Rust editions, while interim changes are limited to fixing errors.
Key features
- 01Built with mdBook into a static HTML site readable offline.
- 02Code listings are tested with mdbook test against the Rust toolchain.
- 03Source is available in Markdown, with releases packaging all example code.
- 04Updated alongside stable, beta, and nightly Rust releases.
Use cases
- Learning Rust from the official introductory material.
- Building a local offline copy of the book with mdBook.
- Contributing corrections or translations to the Rust book.
- Extracting the example code listings to run them locally.
Quick start
- 1
Install mdBook (replace <version_num> with the version from the README's linked file)
cargo install mdbook --locked --version <version_num> - 2
Build the book into the book subdirectory
mdbook build - 3
Open book/index.html in your web browser
Things to know
- The license is not clearly specified in the repository metadata.
- Between major revisions, only error corrections are typically accepted, so other contributions may wait for months or years.
In collections
Topics
FAQ
- What is book?
- The official source of "The Rust Programming Language" book, built with mdBook into the free online edition. This repository holds the Markdown source for "The Rust Programming Language", the official introductory book for Rust. Running mdbook build turns the sources into a browsable HTML version, and the same text is published online for free through the stable, beta, and nightly Rust documentation channels.
- Is book free to use? What license does it have?
- book is open source under the Other license. Check the license terms before using it in commercial products.
- Is book still maintained?
- Actively maintained. The last commit to book was on Oct 28, 2026.
- What can I use book for?
- Learning Rust from the official introductory material. Building a local offline copy of the book with mdBook. Contributing corrections or translations to the Rust book. Extracting the example code listings to run them locally.
- How do I install book?
- Install mdBook (replace <version_num> with the version from the README's linked file): cargo install mdbook --locked --version <version_num> Build the book into the book subdirectory: mdbook build Open book/index.html in your web browser
- Where can I get book?
- The source code and installation instructions are on GitHub: https://github.com/rust-lang/book
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A free, open-source concise guide to TypeScript covering its type system, configuration, and language features, available online and as EPUB.
A Rust command-line tool that builds online books from Markdown files, similar to GitBook.
Free domain registration service with multiple extensions, plus a DNS and website learning guide, documented in this repository.
A multi-day Rust training course developed by Google's Android team, covering Rust from basic syntax to concurrency and bare-metal topics.
A GitHub Action that deploys static site build output to a GitHub Pages branch from your workflow.