icydb_core/lib.rs
1//! Module: lib
2//! Responsibility: crate root for the IcyDB core runtime surface.
3//! Does not own: canister-facing facade APIs from the public `icydb` crate.
4//! Boundary: exposes the engine subsystems used by schema, query, executor, and storage layers.
5
6//! Core runtime for IcyDB: entity traits, values, executors, visitors, and
7//! the ergonomics exported via the `prelude`.
8#![warn(unreachable_pub)] // too complex to adhere to right now
9
10extern crate self as icydb;
11
12#[macro_use]
13pub(crate) mod scalar_registry;
14
15// public exports are one module level down
16pub mod db;
17pub mod error;
18pub mod metrics;
19pub mod model;
20pub mod sanitize;
21pub mod traits;
22pub mod types;
23pub mod validate;
24pub mod value;
25pub mod visitor;
26
27// testing
28#[cfg(test)]
29pub(crate) mod testing;
30
31///
32/// CONSTANTS
33///
34
35/// Maximum number of indexed fields allowed on an entity.
36///
37/// This limit keeps hashed index keys within bounded, storable sizes and
38/// simplifies sizing tests in the stores.
39pub const MAX_INDEX_FIELDS: usize = 4;
40
41///
42/// Prelude
43///
44/// Prelude contains only domain vocabulary.
45/// No errors, executors, stores, serializers, or helpers are re-exported here.
46///
47
48pub mod prelude {
49 pub use crate::{
50 model::{entity::EntityModel, index::IndexModel},
51 traits::{EntityKind, Path},
52 value::{InputValue, OutputValue},
53 };
54}
55
56// Macro/runtime wiring surface used by generated code in local core tests.
57// This mirrors the facade crate's hidden generated-code boundary so derive
58// output can target one stable path regardless of which workspace crate owns
59// the test harness.
60#[doc(hidden)]
61pub mod __macro {
62 pub use crate::error::InternalError;
63 pub use crate::traits::{
64 EnumValue, FieldProjection, PersistedFieldMetaCodec, PersistedStructuredFieldCodec,
65 ValueCodec, ValueSurfaceKind, ValueSurfaceMeta, value_codec_btree_map_from_value,
66 value_codec_btree_set_from_value, value_codec_collection_to_value,
67 value_codec_from_vec_into, value_codec_from_vec_into_btree_map,
68 value_codec_from_vec_into_btree_set, value_codec_into, value_codec_map_collection_to_value,
69 value_codec_vec_from_value,
70 };
71 pub use crate::value::{Value, ValueEnum};
72}