Expand description
Shared vocabulary types and traits for the EventCore event sourcing library.
This crate provides the foundational types that are shared between the main
eventcore crate and adapter implementations like eventcore-postgres.
By extracting these types into a separate crate, we enable feature flag-based
adapter re-exports without circular dependencies.
§Overview
This crate contains:
- Command traits:
CommandLogic,CommandStreams,StreamResolver,Event,NewEvents - Command types:
StreamDeclarations,StreamDeclarationsError - Store trait:
EventStore, withEventStoreErrorandOperation - Command-state snapshots:
CommandStateSnapshotId,CommandStateSnapshot, andCommandStateReplayCheckpoint - Stream types:
StreamId,StreamVersion,StreamWrites,StreamWriteEntry,StreamPattern,StreamPrefix - Event streaming:
EventStream,EventStreamSlice,collect_events - Projection traits:
Projector,EventReader,CheckpointStore,ProjectorCoordinator - Projection types:
EventFilter,EventPage,StreamPosition,FailureContext,FailureStrategy,MaxRetries,BatchSize,DelayMilliseconds,BackoffMultiplier - Errors:
CommandError,BusinessRuleMessage
Structs§
- Attempt
Number - Attempt number for retry operations (1-based).
- Backoff
Multiplier - Backoff multiplier for exponential retry delays.
- Batch
Size - Batch size domain type for limiting query results.
- Business
Rule Message - String-based error for business rule violations created from string messages.
- Command
State Replay Checkpoint - A command-state projection checkpoint after one stream was fully replayed.
- Command
State Snapshot - A durable command-state read-model projection.
- Command
State Snapshot Id - Stable identifier for a command-state projection.
- Delay
Milliseconds - Delay in milliseconds for retry or backoff operations.
- Delivery
Identity Error - Error returned when a delivery identity contains no non-whitespace text.
- Delivery
Position - A positive, source-scoped position in the global delivery sequence.
- Delivery
Source Id - Stable identity for the event source that owns a delivery sequence.
- Event
Filter - Filter criteria for selecting which events to read from the event store.
- Event
Page - Pagination parameters for reading events.
- Event
Stream - An async stream of events read from a single stream, generic over the consumer’s event payload type.
- Event
Stream Slice - Marker type returned by a successful
EventStore::append_events()call. - Event
Type Name - Persisted discriminator for an event type selected for projection.
- Failure
Context - Context provided to error handler when event processing fails.
- MaxConsecutive
Failures - Maximum number of consecutive poll failures before stopping.
- MaxRetries
- Maximum number of retry attempts.
- MaxRetry
Attempts - Maximum number of retry attempts for event processing.
- NewEvents
- Collection of new events produced by a command.
- Persisted
Event Envelope - Opaque persisted event data delivered by a
ProjectionSource. - Persisted
Event Id - Stable persisted event identity, distinct from the delivery position.
- Projection
Selection - Stable selection contract used to read persisted events for a projection.
- Projection
Selection Id - Stable application-supplied identity for a projection selection contract.
- Projector
Name - Stable application-supplied identity for a transactional projector.
- Retry
Count - Count of retry attempts that have been made (0-based).
- Stream
Declarations - Stream
Id - Stream identifier domain type.
- Stream
Pattern - Stream pattern domain type for filtering events by POSIX glob pattern.
- Stream
Position - Opaque cursor representing a location in an
EventReaderdelivery sequence. - Stream
Prefix - Stream prefix domain type for filtering events by stream ID prefix.
- Stream
Version - Stream version domain type.
- Stream
Write Entry - Stream
Writes - Collection of events to write, organized by stream.
Enums§
- Command
Error - Error type for command execution failures.
- Delivery
Upper Bound - Optional inclusive upper bound for a delivery page.
- Event
Store Error - Error type returned by event store operations.
- Failure
Strategy - Strategy for handling event processing failures.
- Operation
- Identifies the event store operation that failed.
- Projection
Selection Error - Error returned when a projection selection is structurally invalid.
- Projection
Stream Filter - Stream selector applied to a projection source read.
- Stream
Declarations Error
Traits§
- Checkpoint
Store - Trait for persisting and retrieving projection checkpoints.
- Command
Logic - Trait defining the business logic of a command.
- Command
Streams - Infrastructure trait describing the streams required to execute a command.
- Event
- Event trait for domain-first event sourcing.
- Event
Reader - Trait for reading events across streams for projections.
- Event
Store - Trait defining the contract for event store implementations.
- Projection
Source - Backend-independent source of lossless, globally ordered persisted events.
- Projector
- Trait for transforming events into read model updates.
- Projector
Coordinator - Trait for coordinating projector leadership across multiple instances.
- Stream
Resolver - Trait for runtime stream discovery when static declarations are insufficient.
Functions§
- collect_
events - Collect every event from a stream into a
Vec, in stream-version order.