HasChildren

Trait HasChildren 

Source
pub trait HasChildren<'tree>: Node<'tree> {
    type Child: Node<'tree>;

    // Provided method
    fn children<'a>(
        &self,
        c: &'a mut TreeCursor<'tree>,
    ) -> impl Iterator<Item = NodeResult<'tree, Self::Child>> + 'a
       where Self: 'a { ... }
}
Expand description

A node that has multiple named children (besides extras) and no fields.

The trait mainly exists for the associated type, because usually these kinds of nodes’ child type is anonymous.

Required Associated Types§

Source

type Child: Node<'tree>

Provided Methods§

Source

fn children<'a>( &self, c: &'a mut TreeCursor<'tree>, ) -> impl Iterator<Item = NodeResult<'tree, Self::Child>> + 'a
where Self: 'a,

Gets the node’s not-extra named children.

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§