This repository is a collection of practical exercises designed to explore the implementation of various design patterns using the Rust programming language. The primary goal is to provide clear and concise examples of how to apply these patterns in real-world projects, leveraging Rust's features and paradigms.
We implement a text editor component with two functions: the first is to add characters and second is to enclose all text into spetial characters like braces, brackets, quotes, single quotes or parenthesis. Both functions implement the "Command" trait and have the rollback method.
We implement a text editor loader that uses two sources: txt and csv, each format has its own factory implementation and returns the object that implements the Document Trait.
We implement two family of geographic entities: the geojson and wkt family. Each family have defined the point, linestring and polygon geometries. This program will have an abstraction to create this objects.
We implement three configurations to create a UI, each configuration has own builder struct, which is called into Window implementation that work as Director object to create the components for ui. At the end, the final user is the main function that define the correct builder implementation, use Window to configure UI, and use Ui methods
src/main: Contains the bootstrap application with the main function. In this function you can start uncomment anything pattern function.
Each pattern its inside from src folder, separated by folders with a pattern name.
use git command:
git clone https://github.com/miguelonCoder/design_patterns_rust.git
use cargo:
cargo run