🦀
RustCanon
Learn
Patterns
Software Engineering
Recipes
Learning Paths
Resources
Resources
Cheatsheet
About
Home
Patterns
Software Engineering
Recipes
Learning Paths
Resources
Cheatsheet
About
← Back to Topics
🎭
Design Patterns in Rust
Classic GoF patterns adapted for Rust ownership model
10 Patterns
10 Interactive
0 Live Demos
Factory Pattern
intermediate
Object creation with traits and generics
🎮 Playground
factory
creational
+1
Builder Pattern
intermediate
Fluent APIs and compile-time validation
🎮 Playground
builder
creational
+1
Observer Pattern
advanced
Event-driven systems with channels
🎮 Playground
observer
behavioral
+1
Strategy Pattern
intermediate
Interchangeable algorithms with traits
🎮 Playground
strategy
behavioral
+1
Adapter Pattern
intermediate
Interface compatibility with wrappers
🎮 Playground
adapter
structural
+1
Decorator Pattern
advanced
Runtime behavior extension
🎮 Playground
decorator
structural
+1
Singleton Pattern
intermediate
Global state with OnceLock and lazy initialization
🎮 Playground
singleton
creational
+2
Command Pattern
advanced
Encapsulate requests as objects with undo/redo support
🎮 Playground
command
behavioral
+2
State Pattern
advanced
State machines with enum and trait-based approaches
🎮 Playground
state
behavioral
+2
Visitor Pattern
advanced
Separate algorithms from object structure
🎮 Playground
visitor
behavioral
+2