Expand description
Procedural macros for the eventide Domain-Driven Design / CQRS toolkit.
This crate provides four attribute macros that remove boilerplate when modelling DDD building blocks in Rust:
| Macro | Applies to | Purpose |
|---|---|---|
[entity] | struct (named) | Mark a type as a DDD entity / aggregate root. |
[entity_id] | tuple struct | Newtype wrapper around a primitive ID with a rich set of conversions. |
[domain_event] | enum (named fields) | Tag an enum as the event family for an aggregate. |
[value_object] | struct or enum | Add the standard derive set expected of immutable value objects. |
Each macro lives in its own module; this crate root only re-exports the
procedural-macro entry points and forwards to the per-macro expand
function. See the documentation on each macro for the supported
attribute arguments and concrete examples.
Attribute Macrosยง
- domain_
event - Tag an enum as the domain-event family for an aggregate.
- entity
- Mark a struct as a DDD entity / aggregate root.
- entity_
id - Turn a single-field tuple struct into a fully-featured entity-ID newtype.
- value_
object - Add the conventional derive set for an immutable value object.