Go to file
2021-01-02 13:04:23 +01:00
.github/workflows Add doc tests to CI (#124) 2021-01-02 12:40:52 +01:00
anti_patterns Added information on --cap-lints to deny-warnings antipattern (#58) 2021-01-02 13:03:36 +01:00
functional Add introductions (#117) 2021-01-02 12:15:33 +01:00
idioms Add doc tests to CI (#124) 2021-01-02 12:40:52 +01:00
patterns Add doc tests to CI (#124) 2021-01-02 12:40:52 +01:00
refactoring Add introductions (#117) 2021-01-02 12:15:33 +01:00
.env Adding mdbook configuration and deployment to gh-pages (#111) 2021-01-01 12:27:42 +01:00
.gitignore Adding mdbook configuration and deployment to gh-pages (#111) 2021-01-01 12:27:42 +01:00
additional_resources.md Adding Nick Camerons talk at PDXRust 2016 to additional resources section (#102) 2021-01-02 12:56:39 +01:00
book.toml Adding mdbook configuration and deployment to gh-pages (#111) 2021-01-01 12:27:42 +01:00
CONTRIBUTING.md Adding Contribution guide (#123) 2021-01-02 12:58:40 +01:00
intro.md Add introductions (#117) 2021-01-02 12:15:33 +01:00
LICENSE Initial commit 2015-08-31 10:06:10 +12:00
README.md Fix typo in filename (#127) 2021-01-02 13:04:23 +01:00
SUMMARY.md Adding Nick Camerons talk at PDXRust 2016 to additional resources section (#102) 2021-01-02 12:56:39 +01:00
template.md Adding Contribution guide (#123) 2021-01-02 12:58:40 +01:00

Rust Design Patterns

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

Contents

Introduction

Idioms

Design patterns

Anti-patterns

  • TODO thread + catch_panic for exceptions
  • TODO Clone to satisfy the borrow checker
  • Deref polymorphism
  • TODO Matching all fields of a struct (back compat)
  • TODO wildcard matches
  • TODO taking an enum rather than having multiple functions
  • TODO unwrap()ing every Result instead of forwarding it
  • #[deny(warnings)]

Contributing

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.

We suggest reading our Contribution guide to get more information on how it works.

Building with mdbook

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

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.

License

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