pub fn collect_debug_snapshot_with_state<A: 'static>(
tree: &ElementTree<A>,
root: ElementId,
viewport: Rect,
selected: Option<ElementId>,
hovered: Option<ElementId>,
frame_index: u64,
) -> DebugSnapshotExpand description
Collects a pre-order subtree and derives warnings with explicit host state.
selected and hovered are copied even when they are outside the collected
subtree. frame_index is opaque and is not incremented internally. Traversal
is O(nodes + child slots); warning computation is expected O(nodes).
ยงExamples
use ailloli_ui_core::{ids::ElementId, Rect};
use ailloli_ui_devtools_core::collect_debug_snapshot_with_state;
use ailloli_ui_runtime::element::ElementTree;
fn capture(tree: &ElementTree<()>, root: ElementId) {
let snapshot = collect_debug_snapshot_with_state(tree, root,
Rect::new(0.0, 0.0, 800.0, 600.0), Some(root), None, 42);
assert_eq!(snapshot.frame_index, 42);
}