Skip to main content

Crate mnesis

Crate mnesis 

Source

Modules§

closing_the_books
Closing the Books — bounded streams instead of snapshots
testing
Zero-infrastructure aggregate test fixture (given/when/then).

Macros§

events
version
A compile-checked Version literal.

Structs§

AggregateRoot
The core event-sourced aggregate container.
ErrorId
A bounded, stack-allocated diagnostic label of at most N UTF-8 bytes.
Events
A non-empty collection of domain events with compile-time capacity.
EventsIntoIter
Owning iterator over Events.
Version
A monotonically increasing event version number.
VersionedEvent
An event paired with its version in the aggregate’s event sequence.

Enums§

KernelError

Constants§

DEFAULT_ERROR_ID_CAP
Default capacity for an ErrorId: 64 bytes, matching stream-id labels.
DEFAULT_MAX_REHYDRATION_EVENTS
Default maximum events during rehydration via replay. Override per-aggregate via Aggregate::MAX_REHYDRATION_EVENTS.

Traits§

Aggregate
Type-level specification binding state, error, and ID types.
AggregateState
State of an event-sourced aggregate. Mutated by applying domain events.
DomainEvent
Handle
Per-command handler trait — the decide function.
Id
Marker for a type usable as a stream / aggregate id.
Message
React
Per-incoming-event-type handler — the react function, dual of Handle<C, N>.
Saga
Saga-level contract. A saga is an aggregate whose events are its own history, plus how to route incoming events and how each own-event maps to an outgoing intent.

Type Aliases§

EventOf
Shorthand for accessing the event type of an aggregate.

Attribute Macros§

aggregate
Attribute macro that transforms a unit struct into an aggregate newtype.

Derive Macros§

DomainEvent