bistun_core/lib.rs
1// Bistun Linguistic Metadata Service (LMS)
2// Copyright (C) 2026 Francis Xavier Wazeter IV
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17//! # Shared Data Models (DTOs) & Foundation
18//! Crate: bistun-core
19//! Ref: [011-LMS-DTO]
20//! Location: `crates/bistun-core/src/lib.rs`
21//!
22//! **Why**: This crate serves as the authoritative central hub for the system's Data Transfer Objects (DTOs) and shared vocabulary. It flattens the internal module hierarchy to provide a clean, ergonomic Public API for all consuming crates and sidecars.
23//! **Impact**: This module defines the "Contract Layer" of the entire Bistun ecosystem; any breaking changes here will instantly propagate across the service boundary, potentially corrupting serialization logic in all downstream SDKs.
24//!
25//! ### Glossary
26//! * **Re-export**: A technique to provide a more ergonomic API by exposing items from submodules at the root level.
27//! * **Contract Layer**: The set of immutable data structures that define the communication protocol between the LMS engine and its clients.
28
29pub mod error;
30pub mod manifest;
31pub mod traits;
32
33// [Persistence Domain]: Opt-in for Engine and Persistence tools
34#[cfg(feature = "persistence")]
35pub mod registry;
36
37// [Operations Domain]: Opt-in for Observability and API tools
38#[cfg(feature = "ops")]
39pub mod ops;
40
41// [Testing Domain]: Opt-in for QA and Simulation
42#[cfg(feature = "testing")]
43pub mod simulation;
44
45// Re-export core DTO for ergonomic API usage
46pub use manifest::{CapabilityManifest, TraitValue};
47
48// Re-export the shared vocabulary (Updated for v2.0.0 Logic Provider)
49pub use traits::{
50 CasingRule, Direction, LmsRule, MorphType, NormRule, PluralRule, SegType, TraitKey, TransRule,
51};
52
53// Re-export Errors
54pub use error::LmsError;
55
56// Re-export Persistence Models
57#[cfg(feature = "persistence")]
58pub use registry::{LocaleProfile, RegistryMetadata, RegistryStore, WormPayload};
59
60// Re-export Operational Models
61#[cfg(feature = "ops")]
62pub use ops::{ResolutionMetrics, SdkState, SyncMetrics};
63
64// Testing Re-exports
65#[cfg(feature = "testing")]
66pub use simulation::*;