HasChild

Trait HasChild 

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

    // Provided method
    fn child(&self) -> NodeResult<'tree, Self::Child> { ... }
}
Expand description

A node that has a single named child (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 child(&self) -> NodeResult<'tree, Self::Child>

Gets the node’s only not-extra named 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§