Expand description
Despatma is a collection of des
ign pat
tern ma
cros (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§
- Creates an abstract visitor for a list of elements.
- Like visitor but allows the mutation of each item visited
Attribute Macros§
- Turns a
trait
into an Abstract Factory. The trait can optionally have super-traits. - The
dependency_container
macro simplifies dependency injection in Rust by automatically wiring dependencies based on animpl
block. It creates a dependency container with public methods that handle the correct setup and wiring of dependencies. - Expands a list of despatma_lib::TraitSpecifier elements over a template. The
TRAIT
andCONCRETE
markers in the template will be replaced with each passed in element. The template itself is annotated with this attribute.