Skip to main content

Module introspect

Module introspect 

Source
Expand description

Host-neutral low-level introspection read surface (phase 5): post-layout geometry, full computed style + provenance, typed component reads, tree serialization, and global runtime state. Low-level introspection read surface (design 4.7): post-layout geometry, full computed style + cascade provenance, typed component reads, tree serialization, and global runtime state.

Like the rest of the DOM read side, every getter reads a process-global snapshot the runtime publishes each tick, so a Send + Sync script host with no &World at call time can inspect the live app. Geometry, component maps, frame state, and the signal set are published by the runtime’s introspection system, and the pointer state by [publish_pointer_state], which every platform installs; computed_style() and matched_rules() re-run the cascade host-side over the same stylesheet + tree the phase-2 detail snapshot already carries.

computed_style(), matched_rules(), dump_tree(), and signals_all() walk the whole tree or re-run the cascade; they are inspection calls, not a per-frame hot path.

Structs§

FrameInfo
Per-frame counters for perf-aware scripts.
IntrospectSnapshot
Geometry + component maps published each tick, keyed by packed handle.
MatchedRuleView
One matched stylesheet rule with cascade provenance, for matched_rules().
NodeGeometry
Per-node geometry published into the snapshot each tick.
NodeRect
Post-layout box, getBoundingClientRect-class. x / y are local to the parent; client_x / client_y are window coordinates.
NodeScroll
Scroll offsets and their travel limits for a scroll container.
PointerSnapshot
Pointer state: window position, pressed buttons, live modifiers.

Functions§

dump_tree
dump_tree(): a whole-tree structural dump (id / tag / classes / rect) for debugging. An inspection call.
frame_info
frame_info(): {frame, dt_ms, dirty_count}.
inner_markup
n.inner_markup(): serialize this node’s children (not the node itself) to .lmn-ish text. The read half of set_inner_markup; reuses the same serializer over the child range.
node_attrs
n.attrs(): the full attribute map, id / class (from the index), text, then every generic attribute.
node_classes
n.classes(): the full class list.
node_component
n.component(name): that component’s public fields as a value map. Err names an unknown / non-whitelisted component; Ok(None) means the component is whitelisted but absent from this node.
node_components
n.components(): the names of the whitelisted Lumen components present on this node.
node_computed_style_map
n.computed_style(): every modeled CSS property the cascade resolved, as (name, value) pairs. Re-runs the cascade host-side; an inspection call.
node_content_rect
n.content_rect(): inner box minus padding + border.
node_entity_id
n.entity_id(): the raw (index, generation) for debugging / handle round-trip. None for a null / reserved-token / invalid handle.
node_inline_style
n.inline_style(): the element.style override map.
node_is_visible
n.is_visible(): effective visibility. A handle absent from the snapshot (despawned) reads false.
node_matched_rules
n.matched_rules(): the stylesheet rules that matched this node with their cascade provenance, ascending in cascade order (last wins).
node_rect
n.rect(): post-layout border-box, local + client.
node_scroll
n.scroll(): scroll offsets and their limits.
node_z_index
n.z_index(): resolved stacking order (0 when unset / unknown).
outer_markup
n.outer_markup(): serialize this subtree to .lmn-ish text.
pointer_state
pointer_state(): window position, buttons, modifiers.
publish_introspection
Publish a freshly-built introspection snapshot for cross-thread readers.
publish_pointer
Publish the pointer state pointer_state() reads.
publish_pointer_state
Publish what the input layer knows about the pointer each tick, so a read from a handler sees this tick’s position.
signals_all
signals_all(): the whole PropertyStore signal set as (name, value) pairs. An inspection call.

Type Aliases§

ComponentFields
A component’s field map: (field, value) pairs.
ComponentMaps
Per-node component field maps: (component_name, fields) in registry order, keyed by packed handle.