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§

BatchSize
Batch size domain type for limiting query results.
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
Placeholder for event stream slice type.
FailureContext
Context provided to error handler when event processing fails.
NewEvents
Collection of new events produced by a command.
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
Placeholder for 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§

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.
StreamResolver
Trait for runtime stream discovery when static declarations are insufficient.