Expand description
Event-independent read-model mutation IR and interpreters.
Mutations describe finite read-model changes without event selectors,
upcasters, owners, placement, or command-preview data. Declarative
crate::projection! bindings map domain events to mutation inputs; the
server and cache interpreters consume the same canonical IR.
Bound mutations adapt to the projection operation vocabulary for physical execution. The old event-owning projection proc-macro authoring path is gone.
Structs§
- Composed
Preview Layer - Composed optimistic layer for one predicted event occurrence.
- Custom
Mutation Handler - Descriptor for a custom (non-portable) async handler that emits mutations.
- Mutation
- Typed authoring handle for a validated mutation program with input type marker.
- Mutation
Cache Program - Atomic cache program derived from one mutation program.
- Mutation
Cache Visibility - Role/app authority and replica coverage facts for one lowering.
- Mutation
Causal Scope - Causal obligation scope derived from mutation targets.
- Mutation
Event Binding - Compiler-visible binding of one event contract to one mutation program.
- Mutation
Expression - A bounded, deterministic expression over a bound mutation input object.
- Mutation
Expression Object Field - One ordered object member in a mutation expression.
- Mutation
Field - One ordered field assignment in a logical mutation.
- Mutation
Field Capability - One typed writable field generated for a read model.
- Mutation
Handler Catalog - Deployment catalog of portable mutation handlers.
- Mutation
Handler Registration - Ownership and topology metadata for one projection arm.
- Mutation
Handler Uniqueness Key - Uniqueness key for projection arm bindings.
- Mutation
Input Binding - One pure binding from an event occurrence into a mutation input path.
- Mutation
KeyCapability - One typed key column generated for a read model.
- Mutation
KeyField - One ordered component of a logical composite key.
- Mutation
Model Identity - Stable identity of a read model for mutation targeting.
- Mutation
Operation - One ordered logical operation template within a mutation program.
- Mutation
Program - A validated, canonical and adapter-neutral mutation program.
- Mutation
Program Id - Domain-separated digest of a complete canonical mutation program.
- Mutation
Program Limits - Version-one resource ceilings included in every program digest.
- Mutation
Relationship Capability - One relationship target generated for a read model.
- Mutation
Returning - Typed returning selection for authoritative server execution.
- Mutation
Server Interpreter - Authoritative server-side mutation interpreter.
- Preview
Owner Contribution - One role-visible owner contribution to a command optimistic layer.
- Projection
Handler - One event contract → one mutation program (an arm of a projection).
- Read
Model Mutation Capabilities - Complete typed internal mutation capability surface for one read model.
Enums§
- Mutation
Assignment - Field assignment that preserves null versus removal versus unknown.
- Mutation
Cache Effect - Semantic cache consequence derived from one mutation operation.
- Mutation
Conflict Target - How a complete-row write resolves primary-key conflicts.
- Mutation
Handler Placement - Placement for a projector handler registration.
- Mutation
Kind - Closed authoritative logical mutation set (event-independent).
- Mutation
Program Error - A typed validation, binding, or interpretation failure for a mutation program.
- Projection
Input Source - How a projection arm fills mutation inputs from a domain-event occurrence.
- Resolved
Mutation Value - Result of evaluating a mutation expression against a bound input object.
Constants§
- MAX_
MUTATION_ EXPRESSION_ DEPTH - Maximum nesting of a mutation expression or literal value.
- MAX_
MUTATION_ OPERATIONS - Maximum operations one mutation program may contain.
- MAX_
MUTATION_ PATH_ SEGMENTS - Maximum number of segments in a mutation input path.
- MUTATION_
OPERATION_ SEMANTICS_ VERSION - Canonical logical mutation semantics version.
- MUTATION_
PROGRAM_ IR_ VERSION - Canonical portable mutation IR version.
Functions§
- assert_
mutation_ backed_ program - Assert a compiled handlers program has at least one non-empty handler.
- bind_
delete_ to_ envelope_ id - Spec: projection arm — deletion event → delete mutation by PK.
- bind_
event_ apply_ mutation - Event-first projection arm with an explicit input binding source.
- bind_
event_ to_ mutation - Bind an exact event contract to a mutation program with explicit inputs.
- bind_
state_ body_ to_ mutation - Spec: projection arm — domain-event body → mutation input object.
- bind_
state_ events_ to_ mutation - Bind several domain-event contracts to the same complete-row upsert mutation.
- bindings_
from_ expressions - Helper to build an input binding list from explicit expressions.
- body_
bindings_ for_ model - Bind every non-skipped physical column of
Masinput_root.field <- body.field. - body_
field_ binding - Construct a simple field binding: mutation input path <- event body path.
- causal_
scopes - Collect deduplicated causal obligation scopes from composed contributions.
- compile_
projection - Compile event→mutation arms into a service projection mount.
- compose_
event_ preview - Compose preview → portable bindings → mutations → cache for one predicted event.
- delete_
by_ pk_ program_ for_ model - Build a delete-by-pk mutation program for model
M. - descriptor_
from_ factories - Construct a const-friendly descriptor from static factories.
- envelope_
binding - Construct a binding from a mutation input path to an envelope field.
- identity_
body_ path_ binder - Build a trivial identity binder where each mutation input path is already a projection body path with the same segments (useful for tests).
- inventory_
single_ model - Inventory for a single output model.
- is_
cache_ writable - Evaluate whether a resolved mutation value is writable in cache.
- lower_
mutation_ cache - Lower a mutation program to role-safe cache effects.
- lower_
projection_ ops_ cache - Lower rewritten projection operations into cache effects (shared vector path).
- lower_
single_ model - Lower a resolved plan for a single ordinary (non-related) model
M. - portable_
binding - Compose a portable binding from event field paths into mutation inputs.
- presence_
label - Placeholder for shared golden-vector evaluation of field presence.
- projection_
value_ type_ for_ column - Map a physical column type to the portable projection value type used in mutation input paths and event body bindings.
- reconcile_
with_ actual - Replace a preview layer with actual-event mutation results.
- required_
input_ paths - Collect required input root paths from a mutation program for catalog digests.
- resolve_
mutation_ program - Resolve an occurrence through a mutation-backed projection program.
- rewrite_
binding_ ops - Helper used by tests to rewrite a binding with an explicit input binder.
- rewrite_
program_ with_ binder - Apply a bound mutation program by rewriting input paths with a custom binder.
- simple_
body_ bindings - Convenience: build a single-field body-path binder map for tests and simple projections.
- state_
upsert_ program_ for_ model - Build a complete-row upsert mutation program for model
Mfrominput_root. - zero_
binding_ preview - Prove zero-binding behavior: empty handlers produce no optimism.