rusty_rtos_json_core/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![forbid(unsafe_code)]
3//! `rusty_rtos_json-core` — the pure heart of `rusty_rtos_json`.
4//!
5//! Rules this crate lives by (from the Kairos mission plan):
6//!
7//! 1. `no_std` by default; `alloc` is a feature, never an assumption.
8//! 2. No CPU, no registers, no allocator, no operating system. Ports and
9//! backends are separate WRAP crates.
10//! 3. Every type that crosses to another Kairos package comes from
11//! `rusty_rtos_core`, so packages compose without conversions.
12//! 4. Handles are indices, never pointers; nothing on a hot path allocates.
13//! 5. `forbid(unsafe)`. The C kernel's trace is the oracle; the scalar path
14//! is the oracle; any faster path is gated identical against it.
15
16#[cfg(feature = "alloc")]
17extern crate alloc;
18
19pub use rusty_rtos_core as rtos_core;
20
21/// The names a firmware wants in scope.
22pub mod prelude {
23 pub use rusty_rtos_core::prelude::*;
24}
25
26/// Crate version, for manifests and logs.
27pub const VERSION: &str = env!("CARGO_PKG_VERSION");
28
29/// `JSON_Validate`: coreJSON's strict ECMA-404 validator.
30pub mod validate;
31
32/// `JSON_SearchConst` and `JSON_Iterate`: query a document in place.
33pub mod search;
34
35pub use search::{Kind, Match, NotFound, Pair, Pairs, Stopped, iterate, pairs, search};
36pub use validate::{MAX_DEPTH, Validity, is_valid, validate};