Skip to main content

Crate architecturekit

Crate architecturekit 

Source
Expand description

Building blocks for DDD-based applications with CQRS and event sourcing, on top of EventSourcingDB.

Structs§

DomainError
A business rule that refused a command, with a message for the caller.
Failure
What failed, as in reading "/books/42", and the error that caused it, if there is one, such as the error of the client SDK.
NotARevision
A value that was meant to be a revision, but is not one.
Precondition
A condition that must hold for the events of a command to be written.
SubjectScheme
How a subject is composed: literal segments and placeholders in braces, as in /tenant/{tenant}/workshop/{workshop}.
SubjectValuesError
The values that SubjectScheme::check refuses, with a message that may reach the caller of an API.

Enums§

Category
What a failure means for its caller, on two axes: whether it is a matter of the domain or of the machinery, and whether trying again unchanged could help.
Permanent
A failure of the category Category::Permanent: trying again will not help.
PreconditionsError
Why a command declares its preconditions in a way they can not be honored (see check_preconditions).
Transient
A failure of the category Category::Transient: trying again later, unchanged, may succeed.

Traits§

Categorized
An error that names its Category.
Command
A command, which knows the subject it acts on, and the conditions under which its events may be written.
Event
The data of an event, which describes what has happened.
Schema
The JSON schema of a type, which describes exactly what serde writes for it.

Functions§

check_preconditions
Checks that a command declares its preconditions in a way they can be honored, before anything is read, as executing a command does.
compare_revisions
Compares two revisions as numbers, since event IDs are decimal strings, and “10” sorts before “9” as text.
parse_revision
Reads a revision, which is an event ID of EventSourcingDB, as a number.

Derive Macros§

Event
Derives architecturekit::Event and architecturekit::Schema for the data of an event. See architecturekit::Event.
Schema
Derives architecturekit::Schema for a type in the data of an event. See architecturekit::Schema.