Skip to main content

architecturekit/
lib.rs

1//! Building blocks for DDD-based applications with CQRS and event sourcing, on
2//! top of [EventSourcingDB](https://www.eventsourcingdb.io).
3#![deny(
4    ambiguous_negative_literals,
5    clippy::pedantic,
6    missing_debug_implementations,
7    missing_docs,
8    trivial_casts,
9    trivial_numeric_casts,
10    unused_extern_crates,
11    unused_import_braces,
12    unused_qualifications,
13    unused_results,
14    unsafe_code,
15    warnings
16)]
17
18// The derive macros name the crate as ::architecturekit, which this makes
19// work within the crate's own tests as well.
20#[cfg(test)]
21extern crate self as architecturekit;
22
23mod command;
24mod decider;
25mod error;
26mod event;
27mod read;
28#[cfg(doctest)]
29mod refusals;
30mod revision;
31mod schema;
32mod state;
33mod store;
34mod subject;
35#[cfg(feature = "testing")]
36pub mod testing;
37mod upcast;
38
39pub use command::{Command, Precondition, PreconditionsError, check_preconditions};
40pub use decider::Decider;
41pub use error::{Categorized, Category, DomainError, Failure, Permanent, Transient};
42pub use event::Event;
43pub use read::{
44    EmptyRange, IfLatestEventIsMissing, LowerBound, Order, ReadOptions, ReadOptionsError, Subjects,
45    UpperBound, check_read_options,
46};
47pub use revision::{NotARevision, compare_revisions, parse_revision};
48pub use schema::Schema;
49pub use state::{EventSchema, Events, State, replay, replay_stored, step, step_stored};
50pub use store::{
51    Error, EventOn, ExecuteError, LoadError, ReadError, RegisterSchemasError, Store, StoreBuilder,
52    WriteError,
53};
54pub use subject::{SubjectScheme, SubjectValuesError};
55pub use upcast::{UpcastEvent, Upcasters};
56
57#[cfg(feature = "derive")]
58pub use architecturekit_macros::{Event, Events, Schema};
59
60#[doc(hidden)]
61#[path = "private.rs"]
62pub mod __private;