Skip to main content

Module reflect

Module reflect 

Source
Expand description

Tiny reflection layer. A component (or script) lists its editable fields as Fields; the editor draws them and the scene/script layer converts them to and from JSON. One mechanism, no per-type UI or serialization code.

Structs§

Field
Named editable property shared by Inspector widgets and scene script properties.

Enums§

AssetKind
Asset picker filter used by the Inspector.
FieldRef
Mutable borrowed value described by a Field. Descriptors must be dropped before borrowing the original value again.

Traits§

Choice
Conversion between enum variants and Inspector dropdown indices.

Functions§

apply_props
Writes saved JSON values into matching fields.
apply_props_checked
Applies saved properties and returns warnings for unknown or invalid values. Valid fields still apply when another property is invalid; missing properties preserve current values. Warning order follows JSON map iteration order.
read_props
Snapshots editable values by property name; duplicate names use the last value.