Expand description
Despatma is a collection of design pattern macros (despatma).
It aims to provide the most common implementations for design patterns at run-time.
This project is still a work in progress. The end goal is to be as Loki is for C++ and more if possible. The following patterns are currently implemented:
- abstract_factory - with the help of interpolate_traits macro
- visitor
- dependency_container
Re-exports§
pub use async_once_cell;
Macros§
- visitor
- Creates an abstract visitor for a list of elements.
- visitor_
mut - Like visitor but allows the mutation of each item visited
Attribute Macros§
- abstract_
factory - Turns a
traitinto an Abstract Factory. The trait can optionally have super-traits. - dependency_
container - The
dependency_containermacro simplifies dependency injection in Rust by automatically wiring dependencies based on animplblock. It creates a dependency container with public methods that handle the correct setup and wiring of dependencies. - interpolate_
traits - Expands a list of despatma_lib::TraitSpecifier elements over a template.
The
TRAITandCONCRETEmarkers in the template will be replaced with each passed in element. The template itself is annotated with this attribute.