Trait LayoutTreeVisitor

Source
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>;

    // Provided method
    fn dirty_marked(&self) { ... }
}
Expand description

A helper type for tree traversal.

Required Methods§

Source

fn parent(&self) -> Option<&T>

Get the parent node.

Source

fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
where F: FnMut(&'a T, usize), T: 'a,

Get child nodes.

Source

fn children_len(&self) -> usize

Get the count of child nodes.

Source

fn child_at(&self, index: usize) -> Option<&T>

Get the specified child.

Provided Methods§

Source

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.

Implementors§