RUSTY — DESIGN PATTERNS
Rust design
patterns.
Twelve design patterns in the order one value meets them, from the place it is built to the brace that drops it. Eleven are read in open-source Rust; one, Adapter, in code written for this series.
The patterns.
Each pattern is one stop in the life of one value. Every article starts with a learning question, shows code that does not compile or does not work, and ends with a test, two questions to answer from memory, and a summary.
IN STOP ORDER — 12 PATTERNS
- 01 Composition root born · 1,043 words
- 02 Builder made · 912 words
- 03 Newtype named · 914 words
- 04 Typestate raised in order · 935 words
- 05 Command becomes a request · 1,014 words
- 06 Functional core lent · 1,155 words
- 07 Strategy carries a choice · 1,126 words
- 08 Enums as states in one state at a time · 952 words
- 09 Typed results refused and returned · 936 words
- 10 Actor sent away · 1,177 words
- 11 Adapter wrapped for a stranger · 1,941 words
- 12 RAII dropped · 1,176 words