pub struct Tree {
pub children: Vec<Tree>,
pub id: Option<TreeId>,
pub length: f64,
pub name: String,
pub type_: Option<TreeType>,
}Expand description
A phylogenetic (or other hierarchical) tree node, shared by picea, react-bio-viz, acacia, and iqtreeserver. The root of a tree is itself a Tree node; a whole tree and a single node use the same shape, so ‘type’ is optional and conventionally set only on a node transmitted as a standalone document (typically the root), not repeated on every nested child.
Fields§
§children: Vec<Tree>Child nodes. Empty array for a leaf.
id: Option<TreeId>Optional node identifier. Not every producer assigns one at parse time (acacia/iqtreeserver derive ids separately); consumers must not assume it is present.
length: f64Branch length leading to this node.
name: StringRaw node label: a leaf name, or an internal-node label such as a bootstrap value or support string (e.g. picea’s “0.989”, IQ-TREE’s “95.3/88”). Kept as the original string for round-tripping; parse further only if you know the producer’s convention.
type_: Option<TreeType>Wire-format object-kind discriminator (see betula’s versioning policy). Optional; omit on nested children.