Skip to main content

Module serial

Module serial 

Source
Expand description

Theme serialization and deserialization via oxicode.

Provides a compact, Pure-Rust binary representation of a theme snapshot (design tokens + typography scale) that can be saved to disk or transmitted over the network and reconstructed without loss.

§Format

The serialized form is a length-prefixed ThemeSnapshot encoded with oxicode’s standard configuration (variable-length integers, little-endian floats, no external schema). The format is opaque binary; for human-editable theme files use serde_json on top of these types instead.

§Example

use oxiui_theme::serial::{deserialize_theme, serialize_theme, ThemeSnapshot};

let snapshot = ThemeSnapshot::default();
let bytes = serialize_theme(&snapshot).expect("serialize");
let restored = deserialize_theme(&bytes).expect("deserialize");
assert_eq!(snapshot, restored);

Structs§

ThemeSnapshot
A serializable snapshot of the design-token, typography, palette, and font layers of a theme.

Functions§

deserialize_theme
Deserialise a ThemeSnapshot from bytes produced by serialize_theme.
serialize_theme
Serialise a ThemeSnapshot to a compact binary blob via oxicode.