pub struct DebugSnapshot {
pub root: u64,
pub viewport: DebugRect,
pub nodes: Vec<DebugNode>,
pub warnings: Vec<DebugWarning>,
pub terminal_inspections: Vec<TerminalDebugSnapshot>,
pub selected: Option<u64>,
pub hovered: Option<u64>,
pub frame_index: u64,
}Expand description
Serializable snapshot of one retained subtree and its derived diagnostics.
§Examples
use ailloli_ui_devtools_core::DebugSnapshot;
fn selected(snapshot: &DebugSnapshot) -> Option<u64> { snapshot.selected }Fields§
§root: u64Requested root element ID, even if the ID was absent from the tree.
viewport: DebugRectLogical viewport used by outside-viewport warnings.
nodes: Vec<DebugNode>Pre-order flattened nodes reachable from root.
warnings: Vec<DebugWarning>All derived warnings in node traversal/category order.
terminal_inspections: Vec<TerminalDebugSnapshot>Optional terminal inspections; omitted from JSON when the feature is enabled but empty.
selected: Option<u64>Selected element ID copied from caller state, whether or not it is present.
hovered: Option<u64>Hovered element ID copied from caller state, whether or not it is present.
frame_index: u64Opaque monotonically increasing frame identity supplied by the host.
Implementations§
Source§impl DebugSnapshot
Linear ID lookup helpers over snapshot nodes.
impl DebugSnapshot
Linear ID lookup helpers over snapshot nodes.
Sourcepub fn node(&self, id: u64) -> Option<&DebugNode>
pub fn node(&self, id: u64) -> Option<&DebugNode>
Returns the first node with id, or None when absent.
Complexity is O(number of nodes).
§Examples
use ailloli_ui_devtools_core::DebugSnapshot;
fn root_name(snapshot: &DebugSnapshot) -> Option<&str> {
snapshot.node(snapshot.root).map(|node| node.widget_name.as_str())
}Sourcepub fn node_mut(&mut self, id: u64) -> Option<&mut DebugNode>
pub fn node_mut(&mut self, id: u64) -> Option<&mut DebugNode>
Returns the first mutable node with id, or None when absent.
Complexity is O(number of nodes). Mutating geometry does not recompute
warnings automatically; call compute_warnings afterward when needed.
§Examples
use ailloli_ui_devtools_core::DebugSnapshot;
fn clear_node_warnings(snapshot: &mut DebugSnapshot, id: u64) {
if let Some(node) = snapshot.node_mut(id) { node.warnings.clear(); }
}Trait Implementations§
Source§impl Clone for DebugSnapshot
impl Clone for DebugSnapshot
Source§fn clone(&self) -> DebugSnapshot
fn clone(&self) -> DebugSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DebugSnapshot
impl Debug for DebugSnapshot
Source§impl<'de> Deserialize<'de> for DebugSnapshot
impl<'de> Deserialize<'de> for DebugSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DebugSnapshot
impl PartialEq for DebugSnapshot
Source§impl Serialize for DebugSnapshot
impl Serialize for DebugSnapshot
impl StructuralPartialEq for DebugSnapshot
Auto Trait Implementations§
impl Freeze for DebugSnapshot
impl RefUnwindSafe for DebugSnapshot
impl Send for DebugSnapshot
impl Sync for DebugSnapshot
impl Unpin for DebugSnapshot
impl UnwindSafe for DebugSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.