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§
Provided Methods§
Sourcefn child(&self) -> NodeResult<'tree, Self::Child>
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.