Skip to main content

Module domain

Module domain 

Source
Expand description

The domain layer: entities, value objects, aggregates, and events.

Structs§

ValidationError
A validation failure for a domain value, naming the type that rejected the value and why.

Traits§

AggregateRoot
An Entity that 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.
DomainEvent
Something that happened in the domain, recorded by an crate::domain::AggregateRoot and later published through an crate::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.
EntityId
A ValueObject used as an crate::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/FromStr string form.
SecretVo
A value object that wraps a secret (API key, password, token, …) which must never appear in logs or error messages by accident.
ValueObject
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 ValueObject newtype around a single WrappedInner::Inner value, only constructible through validation (TryFrom<Self::Inner>).
WrappedInner
A type that wraps a single inner value.