Expand description
The domain layer: entities, value objects, aggregates, and events.
Structs§
- Validation
Error - A validation failure for a domain value, naming the type that rejected the value and why.
Traits§
- Aggregate
Root - An
Entitythat is a consistency boundary and the unit of persistence: changes to it (and whatever it contains) are saved and loaded together, and it records the domain events those changes produce. - Domain
Event - Something that happened in the domain, recorded by an
crate::domain::AggregateRootand later published through ancrate::port::event::EventDispatcher. - Entity
- A domain object whose equality is defined by its identity, not its attributes - the same conceptual entity can change all of its other fields over time and still be “the same” entity.
- Entity
Id - A
ValueObjectused as ancrate::domain::Entity’s identity: always structurally comparable, hashable, orderable, and displayable, so it can be used as a map key, sorted, and printed. - EnumVo
- A fieldless enum treated as a closed set of named values, round-trippable
through its
Display/FromStrstring form. - Secret
Vo - A value object that wraps a secret (API key, password, token, …) which must never appear in logs or error messages by accident.
- Value
Object - A domain object with no identity, whose equality is purely structural: two value objects are the same if their data is the same.
- Wrapped
- A
ValueObjectnewtype around a singleWrappedInner::Innervalue, only constructible through validation (TryFrom<Self::Inner>). - Wrapped
Inner - A type that wraps a single inner value.