Skip to main content

harmos_domain/
lib.rs

1/* ***
2 *
3 * Harmos
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * ***
8 */
9
10/* === Modules === */
11
12mod aggregate;
13mod answer;
14pub mod artifacts;
15pub mod catalog;
16pub mod config;
17mod error;
18pub mod failure;
19mod identity;
20pub mod inventory;
21pub mod journal;
22pub mod listeners;
23pub mod message;
24mod metadata;
25pub mod model;
26pub mod observers;
27pub mod operations;
28pub mod plugin;
29mod presentation;
30mod refusal;
31mod registration;
32pub mod schema;
33pub mod state;
34pub mod streams;
35mod value;
36
37pub mod __private {
38    pub use crate::config::SchemaSettings;
39    pub use crate::plugin::schema_markers as PluginSchemaMarkers;
40    pub use crate::{declare, postcard_product};
41    pub extern crate serde;
42    pub extern crate serde_json;
43    pub use crate::streams::{BatchDefinition, StreamCatalog, StreamRow};
44
45    pub fn stream_definition<S: StreamRow>(id: &'static str, version: u32, window: usize) -> crate::streams::Definition {
46        crate::streams::Definition::declared::<S>(id, version, window)
47            .batching(S::batch_definition())
48            .presentation(S::metadata(), S::row_metadata())
49    }
50
51    pub use crate::inventory as PluginInventory;
52    pub use crate::plugin::{
53        Contribution as PluginContribution, Declared as PluginDeclared, Grant as PluginGrant, Requirement as PluginRequirement,
54        Requirements as PluginRequirements,
55    };
56    pub use crate::{Registrar as PluginRegistrar, RegistrationError as PluginRegistrationError};
57
58    pub trait CarrierContext {
59        const FACILITY: &'static str;
60    }
61
62    pub use crate::answer::Answer;
63    pub use crate::message::MessageError;
64    pub use crate::message::allocation::{add as decoding_add, multiply as decoding_multiply, vector as decoding_vector};
65    pub use crate::message::postcard::{Reader as PostcardReader, Value as PostcardValue};
66    pub use crate::state::{Catalogued, Mutual};
67}
68
69/* === Re-Exports === */
70
71pub use aggregate::Aggregate;
72pub use artifacts::{FRAGMENT_LIMIT, KINDS, PREFIX, ScanError, fragments};
73pub use config::{ConfigError, decode_config, encode_config, validate_config};
74pub use error::{Error, Result};
75pub use failure::Failure;
76pub use identity::{DefinitionId, Identified, Requirement, artifact_subset, qualified, qualified_len, qualify, stream_subset};
77pub use inventory::StreamDeclaration;
78pub use inventory::publications::StreamSpec;
79pub use metadata::{Identifier, IdentifierError, Metadata};
80pub use refusal::{FAILED, RESERVED, Refusal, UNKNOWN, UNREADABLE, reserved};
81pub use registration::{Registrar, Registration, RegistrationError};
82pub use value::{VALUE_DEPTH, Value, ValueError};
83
84#[cfg(feature = "derive")]
85pub use harmos_macros::{
86    catalog, listener, message, observer, operation, plugin, record, records, stream, streams, transaction, transactions,
87};
88pub use message::{MemorySize, Message, MessageError, Portable, Storable, btree_map_memory};
89pub use presentation::{RowMetadata, StreamField};
90pub use streams::{Axial, Batched, Definition, Prefix, Track, Tracked};
91
92/* === Imports === */
93
94// Standard Library Imports
95
96// Third Party Imports
97
98// Local Imports
99
100/* === Constants === */
101
102/* === Macros === */
103
104/* === Type Aliases === */
105
106/* === Structs === */
107
108/* === Enums === */
109
110/* === Traits === */
111
112/* === Implementations === */
113
114/* === Public Functions === */
115
116/* === Private Functions === */
117
118/* === Tests === */