Skip to main content

cqrs_rust_lib/
lib.rs

1#[doc(hidden)]
2pub use async_trait::async_trait as __async_trait;
3
4/// Use this macro instead of `#[async_trait::async_trait]` for WASM compatibility.
5///
6/// On native targets, this expands to `#[async_trait::async_trait]` (Send futures).
7/// On WASM targets, this expands to `#[async_trait::async_trait(?Send)]` (no Send requirement).
8#[macro_export]
9macro_rules! cqrs_async_trait {
10    ($($tt:tt)*) => {
11        #[cfg_attr(not(target_arch = "wasm32"), $crate::__async_trait)]
12        #[cfg_attr(target_arch = "wasm32", $crate::__async_trait(?Send))]
13        $($tt)*
14    };
15}
16
17mod wasm_compat;
18pub use wasm_compat::*;
19
20mod aggregate;
21pub use aggregate::*;
22mod engine;
23pub use engine::*;
24
25mod denormalizer;
26pub use denormalizer::*;
27
28mod errors;
29#[allow(deprecated)]
30pub use errors::*;
31
32mod event;
33pub use event::*;
34
35pub mod problem;
36
37mod event_store;
38pub use event_store::*;
39
40pub mod es;
41#[cfg(feature = "postgres")]
42pub mod pg;
43pub mod read;
44
45#[cfg(feature = "rest")]
46pub mod rest;
47
48mod context;
49pub use context::*;
50mod snapshot;
51
52pub use snapshot::*;
53pub mod dispatchers;
54
55pub mod prelude;
56pub use rest_sql as rsql;
57// Gated on its two callers, both of which are feature-gated.
58#[cfg(any(
59    feature = "rest",
60    feature = "postgres",
61    feature = "mongodb",
62    feature = "surrealdb"
63))]
64pub(crate) mod warn_once;
65
66// Test-only, and gated on the features that have something to log: an unused
67// `pub(crate)` module is `dead_code` under CI's narrower feature sets.
68#[cfg(all(
69    test,
70    any(
71        feature = "rest",
72        feature = "postgres",
73        feature = "mongodb",
74        feature = "surrealdb"
75    )
76))]
77pub(crate) mod log_capture;
78
79#[cfg(test)]
80pub mod testing;