Skip to content

Rust examples for all 23 classic GoF design patterns, and even a little more - part of refactoring.guru examples

License

Notifications You must be signed in to change notification settings

arcsource/design-patterns-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns in Rust

This repository contains Rust 🦀 examples for all 23 classic GoF design patterns, and even a little more.

It is developed to be a part of the Refactoring.Guru project.

Refactoring.Guru

Examples have been designed to introduce a practical applicability in Rust. There are conceptual and read-world examples. In both cases, Rust idiomatic ways of code development and all the specifics are taken into account.

Some patterns are really easy to implement with Rust, mostly creational ones, e.g. Prototype, Static Creation Method.

On the other hand, the Mediator behavioral pattern is the hardest to implement with Rust, considering Rust's specific ownership model with a strict borrow checker rules.

You can find README.md in each example with instructions and additional explanation.

Requirements

These examples have been tested with a stable rustc 1.62 (2021 edition).

All examples can be launched via the command line, using cargo as follows:

cargo run --bin adapter 

License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Creative Commons License

Credits

Authors: Alexander Fadeev (@fadeevab).

About

Rust examples for all 23 classic GoF design patterns, and even a little more - part of refactoring.guru examples

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%