You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Mahdi Azarboon 3aa5c21707
refactor: add note about trade-offs to intro (#407)
Co-authored-by: simonsan <>
2 weeks ago
.github build(deps): bump actions/configure-pages from 4 to 5 (#402) 2 weeks ago
po Add cloud-translated es translation as a starter (#360) 1 year ago
src refactor: add note about trade-offs to intro (#407) 2 weeks ago
styles feat: use mdbook-last-changed to indicate when a file has been last updated 3 months ago
theme feat(pdf): add pdf download (#399) 3 months ago
third_party/mdbook style: format `book.js` with dprint to make diffing easier with upstream (#400) 3 months ago
.dprint.json style: format code blocks 3 months ago
.env feat(pdf): add pdf download (#399) 3 months ago
.gitignore chore: reformat repository with dprint (#370) 10 months ago
.markdownlint.yaml Shorten lines to line-length 80 (#208) 3 years ago chore: reformat repository with dprint (#370) 10 months ago
LICENSE Initial commit 9 years ago chore: update build instructions to account for new dependencies 3 months ago
book.toml style: use smaller margin 3 months ago chore: reformat repository with dprint (#370) 10 months ago

Rust Design Patterns

An open source book about design patterns and idioms in the Rust programming language that you can read here.

You can also download the book in PDF format from this link.


You are missing content in this repository that can be helpful for others, and you are eager to explain it? Awesome! We are always happy about new contributions (e.g. elaboration or corrections on certain topics) to this project.

You can check the Umbrella issue for all the patterns, anti-patterns, and idioms that could be added.

We suggest reading our Contribution guide to get more information on how contributing to this repository works.

Building with mdbook

This book is built with mdbook. You can install it by running cargo install mdbook.

Additional dependencies

  • cargo install mdbook-last-changed for date changes in the footer

  • cargo install mdbook-pandoc for rendering the book to PDF

  • cargo install mdbook-i18n-helpers for translation and i8n support


# Source the .env file to get the PANDOC_VERSION
. ./.env

sudo apt-get update

sudo apt-get install -y texlive texlive-latex-extra texlive-luatex texlive-lang-cjk librsvg2-bin fonts-noto

curl -LsSf$PANDOC_VERSION/pandoc-$PANDOC_VERSION-linux-amd64.tar.gz | tar zxf -

Building the book

If you want to build it locally you can run one of these two commands in the root directory of the repository:

  • mdbook build

    Builds static html pages as output and place them in the /book directory by default.

  • mdbook serve

    Serves the book at http://localhost:3000 (port is changeable, take a look at the terminal output to be sure) and reloads the browser when a change occurs.


The content of this repository is licensed under MPL-2.0; see LICENSE.