pub struct SemanticTree { /* private fields */ }Expand description
The semantic tree of every window.
Implementations§
Source§impl SemanticTree
impl SemanticTree
Source§impl SemanticTree
impl SemanticTree
Sourcepub fn get(&self, id: NodeId) -> Option<&Node>
pub fn get(&self, id: NodeId) -> Option<&Node>
The node with this id, or None for an id from another tree that is out of range.
Sourcepub fn warnings(&self) -> &[TreeWarning]
pub fn warnings(&self) -> &[TreeWarning]
Warnings from building the tree.
Sourcepub fn descendants(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_
pub fn descendants(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_
Every node below id in depth-first order, following owns into owned subtrees.
Each node appears once.
Sourcepub fn descendants_unseen<'a>(
&'a self,
id: NodeId,
seen: &'a mut [bool],
) -> impl Iterator<Item = NodeId> + 'a
pub fn descendants_unseen<'a>( &'a self, id: NodeId, seen: &'a mut [bool], ) -> impl Iterator<Item = NodeId> + 'a
Like descendants, with seen, one flag per node, shared
between calls: a node already marked is neither yielded nor walked into, since its own
descendants were walked when it was marked. Walking from several starts this way
visits each node once and allocates no flags of its own.
Sourcepub fn ancestors(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_
pub fn ancestors(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_
The parents of id, nearest first.
Sourcepub fn text_content(&self, id: NodeId) -> &str
pub fn text_content(&self, id: NodeId) -> &str
The node’s own text joined with its non-hidden descendants’ text in tree order.
Sourcepub fn find_path(&self, path: &NodePath) -> Option<NodeId>
pub fn find_path(&self, path: &NodePath) -> Option<NodeId>
The node at a path from this or another snapshot.
Sourcepub fn by_raw(&self, raw: &[u32]) -> Option<NodeId>
pub fn by_raw(&self, raw: &[u32]) -> Option<NodeId>
The node recorded at a raw index path, or the deepest node whose raw path is a prefix of it, which is the node that absorbed or merged that raw call.
Sourcepub fn renumber_widget_ids(&mut self, renumber: impl FnMut(usize) -> usize)
pub fn renumber_widget_ids(&mut self, renumber: impl FnMut(usize) -> usize)
Rewrites the number of every WidgetId::Unique through renumber. iced numbers unique
ids from one process-wide counter, so a trace renumbers them to compare across runs.