float_pigment_layout

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>;
}
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.

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§