Skip to main content

aam_core/
lib.rs

1//! # aam-rs
2//!
3//! A lightweight AAML (AAM Markup Language) parser and validator.
4//!
5//! ## Features
6//! - Simple `key = value` configuration syntax with comment support (`#`)
7//! - Directive system: `@import`, `@derive`, `@schema`, `@type`
8//! - Schema-based type validation — fields are checked automatically during parsing
9//! - Built-in types: `i32`, `f64`, `string`, `bool`, `color`,
10//!   `math::vector2/3/4`, `physics::kilogram`, `time::datetime`, and more
11//! - Custom type aliases via `@type`
12//! - Inheritance via `@derive` with child-wins-on-conflict semantics
13//!
14//! ## Quick start
15//! ```no_run
16//! use aam_core::aaml::AAML;
17//!
18//! let cfg = AAML::load("config.aam").unwrap();
19//! println!("{}", cfg.find_obj("host").unwrap());
20//! ```
21
22#![warn(clippy::pedantic, clippy::cargo, clippy::nursery)]
23
24#[allow(deprecated)]
25pub mod aaml;
26pub mod builder;
27#[allow(deprecated)]
28#[cfg(feature = "legacy")]
29pub mod commands;
30pub mod error;
31pub mod found_value;
32pub mod pipeline;
33#[allow(deprecated)]
34#[cfg(feature = "legacy")]
35mod types;
36mod types_aam;
37
38#[cfg(feature = "aot")]
39pub mod aot;
40
41#[cfg(feature = "ffi")]
42pub mod ffi;
43
44#[cfg(feature = "python")]
45pub mod python;
46
47pub mod aam;
48pub mod aam_value;
49pub mod from_aam;
50
51pub mod macros;
52
53#[cfg(feature = "jni")]
54pub mod jni;
55#[cfg(feature = "splitter")]
56pub mod splitter;
57#[cfg(feature = "translator")]
58pub mod translator;
59
60#[cfg(feature = "reconstructer")]
61pub mod reconstructer;
62
63/// Python extension-module entry point, compiled only with `--features python`.
64///
65/// In Python: `import aam_py`
66#[cfg(feature = "python")]
67#[pyo3::pymodule(name = "aam_py")]
68fn aam_py(m: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {
69    python::register(m)
70}