Skip to main content

Crate mini_cqrs_es

Crate mini_cqrs_es 

Source
Expand description

§MiniCQRS/ES

MiniCQRS/ES is a Rust library that simplifies the implementation of the Command-Query Responsibility Segregation (CQRS) architectural pattern in your application.

§Key Features

  • Provides traits for defining aggregates, commands, and event consumers.
  • Manages aggregates’ state and events handling with optimistic concurrency.
  • Supports event stores and snapshot stores.
  • Supports queries on read models.
  • All trait methods take &self for easy concurrent usage.
  • No async_trait dependency — uses native async fn in traits.

For more detailed documentation, refer to the specific modules and types provided by MiniCQRS/ES.

Re-exports§

pub use ::anyhow;

Structs§

AggregateSnapshot
The AggregateSnapshot struct represents a snapshot of an aggregate’s state at a specific version.
EventConsumers
A collection of event consumers that processes events through all of them.
EventMetadata
Optional metadata associated with an event.
NewEvent
A new event to be persisted by the event store.
SimpleAggregateManager
A simple implementation of the AggregateManager trait. It loads aggregates by replaying their events from the associated EventStore, but doesn’t implement any storage logic.
SimpleCqrs
A synchronous-consumer implementation of the Cqrs trait.
SnapshotAggregateManager
An aggregate manager that uses a snapshot store to load and store aggregates.
StoredEvent
A persisted event envelope.

Enums§

CqrsError
An error that can occur in a CQRS application.

Traits§

Aggregate
The Aggregate trait defines the behavior of an aggregate, which represents the state of a domain entity and can be modified by applying events.
AggregateManager
The AggregateManager trait defines the behavior for loading and storing the state of aggregates.
Command
The Command trait defines the behavior of a command in a CQRS application.
Cqrs
The Cqrs trait represents the main entry point of a CQRS application.
EventConsumer
The EventConsumer trait defines the behavior of an event consumer, which is responsible for processing events (e.g., updating read models, sending notifications).
EventPayload
The EventPayload trait defines the behavior of an event payload, representing the change the event made to the state of an aggregate.
EventStore
The EventStore trait defines the behavior for storing and loading events, allowing the application to keep a historical record of state changes.
Query
The Query trait represents a query that allows to retrieve information from read models.
QueryRunner
The QueryRunner trait can be implemented to provide a query method on your types.
Repository
A marker trait for repository types used in read model projections.
SnapshotStore
The SnapshotStore trait defines the behavior for storing and loading aggregate snapshots.