sim_lib_scene/lib.rs
1//! Scene value model and `codec:scene` for the SIM Web-UI (WEBUI_4).
2//!
3//! A Scene is a portable graphical intermediate representation that is itself a
4//! SIM value: a tree of scene nodes built on kernel `Value`/`Expr` using open
5//! maps with a `kind` tag, never a closed kernel enum. The browser is the only
6//! thing that turns a Scene into pixels; everything upstream just produces
7//! Scene values. Because a Scene is a value it round-trips through
8//! `codec:scene`, can be snapshotted, diffed, golden-tested, sent over the
9//! wire, or read by an agent.
10//!
11//! This crate provides:
12//!
13//! - the scene node [`kinds`] (open metadata, not a closed enum);
14//! - a [`model`] of builders, accessors, and fail-closed validation;
15//! - a lossless canonical [`text`] form for the scene-data subset of `Expr`;
16//! - the [`codec`] `codec:scene` (a domain codec) plus scene node [`shapes`];
17//! - a [`diff()`]/apply pair over scenes (scene diffs are themselves values).
18
19#![forbid(unsafe_code)]
20#![deny(missing_docs)]
21
22pub mod build;
23mod citizen;
24pub mod codec;
25pub mod diff;
26pub mod kinds;
27pub mod model;
28pub mod shapes;
29pub mod text;
30
31pub use build::{RESERVED_DATA_KEYS, badge, box_, data_map, stack, sym, text_node};
32pub use citizen::{SceneDescriptor, scene_descriptor_class_symbol};
33pub use codec::{SceneCodec, SceneCodecLib, scene_codec_symbol};
34pub use diff::{apply, diff};
35pub use kinds::{SCENE_KINDS, SCENE_NAMESPACE, is_known_kind, scene_kind};
36pub use model::{SceneError, map, node, node_kind, validate_scene};
37pub use shapes::{SceneNodeShape, SceneShape, scene_shape_specs, scene_shape_symbol};
38
39#[cfg(test)]
40mod tests;