Skip to main content

evorule_primitives/
lib.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2// Copyright (C) 2026 EvoRule Project
3// This file is part of EvoRule, licensed under GNU Affero General Public License v3 or later.
4//! EvoRule primitives — base value types shared across the ecosystem.
5//!
6//! This crate is the single definition site for the deterministic JSON
7//! value model ([`JsonValue`], [`ObjectMap`]) and the I/O handler contract
8//! ([`IoHandler`], [`IoResult`]).
9//!
10//! # Design principles
11//! - Zero evorule-\* dependencies (base-primitive layer discipline)
12//! - `#![no_std]` compatible (uses `alloc` only)
13//! - Deterministic iteration (`BTreeMap`-backed object maps)
14//! - Never panics (all conversions return `Option` / `Result`)
15//!
16//! # Consumers
17//! Ecosystem crates re-export these types via `pub use` shims, which keeps
18//! their public API paths and type identities unchanged (Rust identifies
19//! types by definition site — a re-export never creates a new type).
20//!
21//! # Modules
22//! - [`value`] — `JsonValue` / `ObjectMap` deterministic data model
23//! - [`io_handler`] — object-safe async I/O handler trait
24
25#![no_std]
26#![forbid(unsafe_code)]
27#![deny(missing_docs)]
28// Never-panic guarantees: forbid panic-prone patterns
29#![deny(clippy::unwrap_used)]
30#![deny(clippy::expect_used)]
31#![deny(clippy::indexing_slicing)]
32#![deny(clippy::panic)]
33
34extern crate alloc;
35
36pub mod io_handler;
37pub mod value;
38
39pub use io_handler::{IoHandler, IoResult};
40pub use value::{JsonValue, ObjectMap};