Skip to main content

Crate datum_persistence

Crate datum_persistence 

Source
Expand description

Event sourcing, durable state, and CQRS persistence for Datum.

The crate provides byte-oriented storage SPIs for event journals, snapshots, and durable state, together with a conformant in-memory reference backend. Serialization is synchronous and selected explicitly through a per-type SerializerCatalog; the optional default protobuf feature supplies ProstSerializer without exposing protobuf types in the feature-independent façade.

Re-exports§

pub use backend::MemoryDurableStateStore;
pub use backend::MemoryJournal;
pub use backend::MemorySnapshotStore;
pub use testkit::FailingJournal;
pub use testkit::assert_durable_state_store_conformance;
pub use testkit::assert_journal_conformance;
pub use testkit::assert_snapshot_store_conformance;

Modules§

backend
First-party persistence storage backends.
projection
Managed read-side projection runtime, configuration, and storage contracts.
query
Persistence Query capability traits and Datum stream adapters.
state
Durable-state behavior blueprints, effects, recovery, and runtime handles.
testkit
Public conformance suite for persistence storage backends.

Structs§

AtomicWrite
A non-empty, gapless sequence of events committed all-or-nothing.
Effect
A command decision for an EventSourcedBehavior.
EventSourcedBehavior
Immutable, side-effect-free event-sourced behavior blueprint.
EventSourcedHandle
Spawned event-sourced behavior handle.
EventSourcedMessage
A message accepted by an event-sourced behavior’s single ordered ingress.
EventSourcedRuntime
Runtime resources supplied only when a behavior is spawned.
EventSourcedState
A point-in-time state and sequence-number observation.
IdentityAdapter
Identity event/state adapter for cases where domain and journal types match.
PersistenceId
Stable identity of one persistent entity.
ProstSerializer
Protobuf serializer for hand-written prost::Message journal types.
PublishedEvent
A confirmed domain-typed event published by a running behavior.
ReplayRange
Inclusive replay selection for one persistence id.
ReplyEffect
An effect that statically records either a reply or an explicit no-reply decision.
Revision
Monotonic revision of one durable-state value.
SelectedSnapshot
Snapshot metadata paired with its serialized state frame.
SequenceNr
Monotonic event sequence number for one persistence id.
SerializedPayload
Durable serialized value stored by persistence backends.
SerializerCatalog
Per-journal-type registry with one primary encoder and id-based decoders.
SerializerId
Stable serializer identifier stored with every serialized payload.
SnapshotCriteria
Inclusive sequence-number and timestamp bounds for snapshot selection.
SnapshotMetadata
Durable identity and timestamp of one saved snapshot.
StoredEvent
One serialized event as stored by a journal backend.
Tag
Tag attached to a stored event or durable-state change for querying.
VersionedState
Latest serialized durable state together with its CAS revision.

Enums§

AppendOutcome
Result of one input crate::AtomicWrite in a journal append batch.
EventSourcedSignal
Persistence-specific lifecycle and maintenance signals.
PersistenceError
Errors produced by persistence operations.
Recovery
Recovery mode for an event-sourced behavior.
RetentionCriteria
Count-based snapshot retention policy.
SnapshotSelection
Snapshot selection used during recovery.

Constants§

DEFAULT_PERSISTENCE_ID_SEPARATOR
Default separator between the entity type and entity id.

Traits§

DurableStateStore
Byte-oriented durable-state storage provider.
EventAdapter
Converts domain events to and from their journal representation.
IntoEventHandlerResult
Converts an event-handler return value into a persistence result.
Journal
Byte-oriented event journal storage provider.
PersistenceSerializer
Synchronous serializer for one journal representation type.
SnapshotStore
Byte-oriented snapshot storage provider.
StateAdapter
Converts domain state to and from its snapshot or durable-state representation.

Type Aliases§

EventStream
Owned asynchronous stream returned by journal replay.
PersistenceResult
Result type used by datum-persistence.