Expand description
Tree structure support for Altium record hierarchies.
Altium records form tree structures where parent-child relationships are encoded via the OWNERINDEX parameter. This module provides:
RecordTree- Generic tree structure with navigation methodsRecordId- Unique identifier for records within a treeTreeWalker- Depth-first iterator over tree nodes
§Example
ⓘ
use altium_format::tree::RecordTree;
use altium_format::records::sch::SchRecord;
// Build tree from flat record list
let tree = RecordTree::from_records(records);
// Navigate the tree
for (id, record) in tree.roots() {
println!("Root: {:?}", record);
for (child_id, child) in tree.children(id) {
println!(" Child: {:?}", child);
}
}
// Walk entire tree depth-first
for (id, record, depth) in tree.walk_depth_first() {
println!("{:indent$}{:?}", "", record, indent = depth * 2);
}Structs§
- Breadth
First Walker - Breadth-first iterator over tree nodes.
- Record
Id - Unique identifier for a record within a tree.
- Record
Tree - Generic tree structure for Altium records.
- Tree
Walker - Depth-first iterator over tree nodes.
Enums§
- Parent
Ref - Reference to a parent record.
Traits§
- Tree
Record - A trait for records that can participate in a tree structure.