Skip to main content

Crate sim_lib_scene

Crate sim_lib_scene 

Source
Expand description

Scene value model and codec:scene for the SIM Web-UI (WEBUI_4).

A Scene is a portable graphical intermediate representation that is itself a SIM value: a tree of scene nodes built on kernel Value/Expr using open maps with a kind tag, never a closed kernel enum. The browser is the only thing that turns a Scene into pixels; everything upstream just produces Scene values. Because a Scene is a value it round-trips through codec:scene, can be snapshotted, diffed, golden-tested, sent over the wire, or read by an agent.

This crate provides:

  • the scene node kinds (open metadata, not a closed enum);
  • a model of builders, accessors, and fail-closed validation;
  • a lossless canonical text form for the scene-data subset of Expr;
  • the codec codec:scene (a domain codec) plus scene node shapes;
  • a diff()/apply pair over scenes (scene diffs are themselves values).

Re-exports§

pub use build::RESERVED_DATA_KEYS;
pub use build::badge;
pub use build::box_;
pub use build::data_map;
pub use build::stack;
pub use build::text_node;
pub use codec::SceneCodec;
pub use codec::SceneCodecLib;
pub use codec::scene_codec_symbol;
pub use diff::apply;
pub use diff::diff;
pub use kinds::SCENE_KINDS;
pub use kinds::SCENE_NAMESPACE;
pub use kinds::is_known_kind;
pub use kinds::scene_kind;
pub use model::SceneError;
pub use model::node;
pub use model::node_kind;
pub use model::validate_scene;
pub use shapes::SceneNodeShape;
pub use shapes::SceneShape;
pub use shapes::scene_shape_specs;
pub use shapes::scene_shape_symbol;

Modules§

build
Scene construction helpers.
codec
codec:scene: the domain codec for Scene values.
diff
Scene diff and patch application.
kinds
Scene node kinds.
model
Scene value model: builders, accessors, and fail-closed validation.
shapes
Shapes for scene node kinds.
text
Lossless canonical text for the scene-data subset of Expr.

Structs§

SceneDescriptor
A validated Scene wrapped as a runtime Citizen object.

Functions§

map
Build a plain data map from string-keyed entries (keys become core-less symbols). Use node to build a tagged scene node. A map value from string-keyed entries (keys become unqualified symbols).
scene_descriptor_class_symbol
Returns the class symbol for the Scene descriptor Citizen.
sym
An unqualified symbol value: Expr::Symbol(Symbol::new(name)).