Expand description
Type-level lists for deserializing type-erased leaf configs at replay time.
During recording, leaf element configs (text, images, custom widgets) are serialized into
LeafConfigData blobs without preserving their Rust type. At replay, the
LeafConfigList chain tells the interpreter which concrete types to try, in order.
§Building a leaf type list
Start with LeafConfigListNil (the empty list) and extend it using LeafConfigList::new
or LeafConfigList::extend:
ⓘ
use cotis_modules_debug::serialize_targets::leaf_serialization::{LeafConfigList, LeafConfigListNil};
// Single leaf type:
type Leafs = LeafConfigList<TextElementConfig<'static>, LeafConfigListNil>;
let leafs = Leafs::new();
// Multiple leaf types (order matters — see below):
type Leafs = LeafConfigList<
TextElementConfig<'static>,
LeafConfigList<ImageElementConfig<'static>, LeafConfigListNil>,
>;
let leafs = LeafConfigList::<TextElementConfig<'static>, _>::extend();§Deserialization order
When replaying a LeafConfig
instruction, the list tries to deserialize the JSON blob as the head type first. If that
fails, it recurses to the tail. Put more specific leaf types before more general ones
to avoid ambiguous matches.
Structs§
- Leaf
Config Data - Type-erased JSON storage for a leaf element config recorded during stage 1.
- Leaf
Config List - A type-level cons-list of leaf config types used for replay deserialization.
- Leaf
Config List Nil - Terminal node of a
LeafConfigListchain (empty list).
Traits§
- Leaf
Config List Compatible - Type-level dispatch for replaying
LeafConfigDataagainst open elements.