capability-skeleton-mock 0.1.0

A Rust crate for constructing and managing hierarchical skeleton structures with diverse node types, enabling advanced testing and simulation scenarios.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// ---------------- [ File: capability-skeleton-mock/src/single_node_skeleton.rs ]
crate::ix!();

/// A single node skeleton with `leaf_count`.
pub fn single_node_skeleton(leaf_count: u16) -> Skeleton {
    let node0 = SkeletonNodeBuilder::default()
        .id(0)
        .name("SingleNode")
        .original_key("SingleNode")
        .leaf_count(leaf_count)
        .build(NodeKind::LeafHolder)
        .unwrap();
    SkeletonBuilder::default()
        .nodes(vec![node0])
        .root_id(Some(0))
        .build()
        .unwrap()
}