Skip to main content

Crate eventcore_types

Crate eventcore_types 

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

  • Core traits: Event, EventStore, CommandLogic, CommandStreams, StreamResolver
  • Domain types: StreamId, StreamVersion, StreamWrites, StreamWriteEntry
  • Event handling: EventStreamReader, EventStreamSlice, NewEvents
  • Command types: StreamDeclarations, StreamDeclarationsError
  • Errors: EventStoreError, CommandError, Operation

Structs§

AttemptNumber
Attempt number for retry operations (1-based).
BackoffMultiplier
Backoff multiplier for exponential retry delays.
BatchSize
Batch size domain type for limiting query results.
DelayMilliseconds
Delay in milliseconds for retry or backoff operations.
EventFilter
Filter criteria for selecting which events to read from the event store.
EventPage
Pagination parameters for reading events.
EventStreamReader
Event stream reader generic over event payload type.
EventStreamSlice
Marker type returned by a successful EventStore::append_events() call.
FailureContext
Context provided to error handler when event processing fails.
MaxConsecutiveFailures
Maximum number of consecutive poll failures before stopping.
MaxRetries
Maximum number of retry attempts.
MaxRetryAttempts
Maximum number of retry attempts for event processing.
NewEvents
Collection of new events produced by a command.
RetryCount
Count of retry attempts that have been made (0-based).
StreamDeclarations
StreamId
Stream identifier domain type.
StreamPosition
Global stream position representing a location in the ordered event log.
StreamPrefix
Stream prefix domain type for filtering events by stream ID prefix.
StreamVersion
Stream version domain type.
StreamWriteEntry
StreamWrites
Collection of events to write, organized by stream.

Enums§

CommandError
Error type for command execution failures.
EventStoreError
Error type returned by event store operations.
FailureStrategy
Strategy for handling event processing failures.
Operation
Identifies the event store operation that failed.
StreamDeclarationsError

Traits§

CheckpointStore
Trait for persisting and retrieving projection checkpoints.
CommandLogic
Trait defining the business logic of a command.
CommandStreams
Infrastructure trait describing the streams required to execute a command.
Event
Event trait for domain-first event sourcing.
EventReader
Trait for reading events globally for projections.
EventStore
Trait defining the contract for event store implementations.
Projector
Trait for transforming events into read model updates.
ProjectorCoordinator
Trait for coordinating projector leadership across multiple instances.
StreamResolver
Trait for runtime stream discovery when static declarations are insufficient.