Skip to main content

Module mutation

Module mutation 

Source
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§

ComposedPreviewLayer
Composed optimistic layer for one predicted event occurrence.
CustomMutationHandler
Descriptor for a custom (non-portable) async handler that emits mutations.
Mutation
Typed authoring handle for a validated mutation program with input type marker.
MutationCacheProgram
Atomic cache program derived from one mutation program.
MutationCacheVisibility
Role/app authority and replica coverage facts for one lowering.
MutationCausalScope
Causal obligation scope derived from mutation targets.
MutationEventBinding
Compiler-visible binding of one event contract to one mutation program.
MutationExpression
A bounded, deterministic expression over a bound mutation input object.
MutationExpressionObjectField
One ordered object member in a mutation expression.
MutationField
One ordered field assignment in a logical mutation.
MutationFieldCapability
One typed writable field generated for a read model.
MutationHandlerCatalog
Deployment catalog of portable mutation handlers.
MutationHandlerRegistration
Ownership and topology metadata for one projection arm.
MutationHandlerUniquenessKey
Uniqueness key for projection arm bindings.
MutationInputBinding
One pure binding from an event occurrence into a mutation input path.
MutationKeyCapability
One typed key column generated for a read model.
MutationKeyField
One ordered component of a logical composite key.
MutationModelIdentity
Stable identity of a read model for mutation targeting.
MutationOperation
One ordered logical operation template within a mutation program.
MutationProgram
A validated, canonical and adapter-neutral mutation program.
MutationProgramId
Domain-separated digest of a complete canonical mutation program.
MutationProgramLimits
Version-one resource ceilings included in every program digest.
MutationRelationshipCapability
One relationship target generated for a read model.
MutationReturning
Typed returning selection for authoritative server execution.
MutationServerInterpreter
Authoritative server-side mutation interpreter.
PreviewOwnerContribution
One role-visible owner contribution to a command optimistic layer.
ProjectionHandler
One event contract → one mutation program (an arm of a projection).
ReadModelMutationCapabilities
Complete typed internal mutation capability surface for one read model.

Enums§

MutationAssignment
Field assignment that preserves null versus removal versus unknown.
MutationCacheEffect
Semantic cache consequence derived from one mutation operation.
MutationConflictTarget
How a complete-row write resolves primary-key conflicts.
MutationHandlerPlacement
Placement for a projector handler registration.
MutationKind
Closed authoritative logical mutation set (event-independent).
MutationProgramError
A typed validation, binding, or interpretation failure for a mutation program.
ProjectionInputSource
How a projection arm fills mutation inputs from a domain-event occurrence.
ResolvedMutationValue
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 M as input_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 M from input_root.
zero_binding_preview
Prove zero-binding behavior: empty handlers produce no optimism.