pub trait CloneNode {
// Required method
fn clone_node(&self) -> Box<dyn Node>;
}
Expand description
Helper trait to enable cloning boxed trait objects for Node.
This trait provides the mechanism for cloning Box<dyn Node>
objects,
which is necessary for tree operations that need to duplicate node structures.
It’s automatically implemented for any type that implements Node + Clone
.
§Implementation Note
This trait is automatically implemented via a blanket implementation, so you typically don’t need to implement it manually.
Required Methods§
Sourcefn clone_node(&self) -> Box<dyn Node>
fn clone_node(&self) -> Box<dyn Node>
Creates a cloned copy of this node as a boxed trait object.
§Returns
A new Box<dyn Node>
containing a clone of this node.