Expand description
Where a repo’s entities get their id from, and the one public route into
an EntityEvents container.
A repo resolves the id of every entity it creates according to its
IdSource: FromRepo (the default, the repo generates it) or
FromCaller (the caller puts it in the New* value). The
IntoEvents implementation of a New* type receives an
EntityEventsBuilder whose second parameter is that source, so
EntityEventsBuilder::id exists only when the repo resolved one, and a
FromRepo New* has no API through which a caller-chosen id can reach
the insert.
Structs§
- Entity
Events Builder - The id source applied, no events yet. Handed to
IntoEvents::into_eventsby the generated repo code and consumed byinitial_events, the only public way to build anEntityEventscontainer. - From
Caller - The caller puts the id (a deterministic one) in the
New*value, which hands it toEntityEventsBuilder::initial_events. A caller’s id is a uniqueness claim, so the primary key stays among the repo’s constraint violations. - From
Repo - The repo resolved the id before
into_eventsruns; theNew*type has no id field and reads it withEntityEventsBuilder::id.
Enums§
- Ensured
- What
create_or_find_by_id_in_opdid for a repo with deterministic ids.
Traits§
- IdSource
- Where the id of a newly created entity comes from. Sealed:
FromRepoandFromCallerare the only sources.