pub struct InspectNode {
pub id: WidgetId,
pub parent: Option<WidgetId>,
pub type_name: &'static str,
pub debug_label: Option<Cow<'static, str>>,
pub bounds: Rect,
pub children: Vec<WidgetId>,
pub depth: usize,
}Expand description
One node of a read-only widget-tree snapshot, as produced by
WidgetTree::inspect.
Plain owned data with no borrow of the tree, so a caller (a devtools service,
a test) can hold or forward it freely. Deliberately renderer-agnostic and
serialization-agnostic: geometry is kurbo, and any wire format belongs to
the consumer, not to this crate.
Fields§
§id: WidgetIdThe node’s stable WidgetId.
parent: Option<WidgetId>The parent’s id, or None for a root.
type_name: &'static strThe concrete widget type’s name — see WidgetPod::type_name.
debug_label: Option<Cow<'static, str>>The pod’s optional debug label — see WidgetPod::set_debug_label.
bounds: RectThe widget’s border box in absolute window coordinates, logical px:
the pod’s recorded layout origin accumulated down from the root, plus its
recorded size. Rect::ZERO-sized until a layout pass has run.
children: Vec<WidgetId>This node’s children: the arena’s own children first (insertion order),
then the widget’s owned ChildPods in declaration order.
depth: usizeDistance from the root (roots are 0).