Skip to main content

harmos_runtime/state/
mod.rs

1/* ***
2 *
3 * Harmos
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * ***
8 */
9
10/* === Modules === */
11
12pub(crate) mod capture;
13mod entry {
14    pub use harmos_domain::state::{
15        At, CausationId, CorrelationId, Entry, Link, Metadata, Position, PrincipalId, Receipt, RequestKey, Timestamp,
16    };
17}
18mod envelope;
19mod history;
20mod managed;
21mod manager;
22mod record;
23pub(crate) mod recovery;
24pub(crate) mod snapshot;
25mod snapshot_codec;
26mod transaction;
27mod writer;
28
29/* === Re-Exports === */
30
31pub use crate::error::Error;
32pub use capture::{CaptureError, CaptureLimits, JournalCapture};
33pub use entry::{At, CausationId, CorrelationId, Entry, Link, Metadata, Position, PrincipalId, Receipt, RequestKey, Timestamp};
34pub use envelope::{DefinitionId, Envelope, FactSource, Kind, Recorded, SystemFact};
35pub use harmos_domain::state::{RecordDefinitions, TransactionDefinitions};
36pub use history::{Focus, Origin, Reversals};
37pub use managed::ManagedState;
38pub use manager::StateManager;
39pub(crate) use manager::{Context, Feed, TrackedState};
40pub use record::{CatalogCodec, PreparationError, Prepared, Record, RecordCatalog, RecordProjection, Records};
41pub use snapshot::SnapshotPolicy;
42pub use transaction::{DecodeError, Invert, Never, Transaction, TransactionCatalog, Undoable};
43
44// The proof traits generated authoring code reaches through `__private`: they
45// are how a declared pair is checked mutual and how a declared inverse is
46// checked to be a member of the catalog that will commit it. Public because an
47// application's generated code names them, hidden because nothing else may.
48
49pub use transaction::{Catalogued, Mutual};
50
51// What boot needs of the journal's insides and nothing more: the fold replay
52// rebuilds, the hook it re-derives inverses through, and the version table it
53// dispatches stored entries by.
54pub(crate) use history::{ReadRequest, Reads, ReplayPayload, Tail, Undoable as UndoEntry, Undos, replay};
55pub(crate) use transaction::{Inverting, dispatch};
56
57/* === Imports === */
58
59// Standard Library Imports
60
61// Third Party Imports
62
63// Local Imports
64
65/* === Constants === */
66
67/* === Macros === */
68
69/* === Type Aliases === */
70
71/* === Structs === */
72
73/* === Enums === */
74
75/* === Traits === */
76
77/* === Implementations === */
78
79/* === Public Functions === */
80
81/* === Private Functions === */
82
83/* === Tests === */