Trait Node
Source pub trait Node {
type Kind: PartialEq;
type Weight: Default + Copy + Ord + Add<Output = Self::Weight>;
// Required methods
fn kind(&self) -> Self::Kind;
fn weight(&self) -> Self::Weight;
}
Expand description
An abstraction for a generic tree node.
The type of this Node’s kind.
Only Nodes of the equal kind can replace each other.
The type of this Node’s weight.
The default value of this type is assumed to be the additive identity (i.e. zero).
Returns this Node’s kind.
Returns the cost of inserting or deleting this Node.
A Node’s weight should be independent of the weight of its children.