pub trait LayoutTreeVisitor<T: LayoutTreeNode> {
// Required methods
fn parent(&self) -> Option<&T>;
fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
where F: FnMut(&'a T, usize),
T: 'a;
fn children_len(&self) -> usize;
fn child_at(&self, index: usize) -> Option<&T>;
fn children_iter<'a, 'b: 'a>(&'b self) -> impl Iterator<Item = &'a T>
where T: 'a;
// Provided method
fn dirty_marked(&self) { ... }
}Expand description
A helper type for tree traversal.
Required Methods§
Sourcefn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
Get child nodes.
Sourcefn children_len(&self) -> usize
fn children_len(&self) -> usize
Get the count of child nodes.
Sourcefn children_iter<'a, 'b: 'a>(&'b self) -> impl Iterator<Item = &'a T>where
T: 'a,
fn children_iter<'a, 'b: 'a>(&'b self) -> impl Iterator<Item = &'a T>where
T: 'a,
Get children iterator.
Provided Methods§
Sourcefn dirty_marked(&self)
fn dirty_marked(&self)
A notifier that the node has been marked dirty.
When LayoutNode::mark_dirty is called, some related nodes (e.g. the ancestors) are also marked dirty automatically.
These calls tells which nodes are marked dirty.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.