Expand description
Read Models - storage-backed projections and read-optimized views.
Relational models stage explicit row mutations:
ⓘ
use distributed::read_model::{ReadModelWritePlanBuilder, ReadModelWritePlanCommitExt};
let mut read_models = ReadModelWritePlanBuilder::new();
read_models.upsert(&player)?;
read_models.upsert_related(&player, "weapons", &weapon)?;
repo.read_models(read_models).commit(&mut aggregate).await?;Persistent repositories expose the staging shape through
ReadModelWritePlanCommitExt::read_models, returning a future
from commit.
Distributed projectors can commit a write plan directly against a read-model adapter. Projection handlers should make those writes idempotent so bus retries can safely replay the same message:
ⓘ
let mut read_models = ReadModelWritePlanBuilder::new();
read_models.upsert(&view)?;
let outcome = read_models.commit(&read_store)?;Re-exports§
pub use change::ReadModelChange;
Modules§
- change
- Read-model change notification seam (always compiled).
Structs§
- InMemory
Read Model Store - In-memory read model store backed by a HashMap.
- Read
Model Include Rows - Rows loaded for one requested relationship include.
- Read
Model Load Builder - Builder for one explicit primary-key read-model load over the async store traits.
- Read
Model Load Graph - Untyped graph loaded by a relational read-model adapter.
- Read
Model Load Request - A request an adapter can satisfy with a primary-key read plus explicit includes.
- Read
Model Query Capabilities - Adapter capabilities for primary-key relational read-model loads.
- Read
Model Workspace - Store-bound read-model workspace for load, mutate, sync, commit workflows.
- Read
Model Write Plan Builder - Detached builder for read-model write plans that are applied at commit.
- Versioned
- A versioned wrapper around read model data for optimistic concurrency control.
Traits§
- Read
Model - Trait implemented by the derive macro for read-model identity metadata.
- Read
Model Workspace Ext - Extension trait that starts a tracked read-model workspace from an async store.
- Relational
Read Model - Opt-in trait for table-mapped relational read models.
- Relational
Read Model Includes - Relationship hydration hooks generated for table-mapped read models.