Crate despatma

source ·
Expand description

githubcrates-iodocs-rsworkflow

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:

Re-exports§

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 an impl 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 and CONCRETE markers in the template will be replaced with each passed in element. The template itself is annotated with this attribute.