1 unstable release
Uses new Rust 2024
| 0.1.0 | Jul 13, 2025 |
|---|
#31 in #skeleton
Used in 5 crates
49KB
408 lines
Grower Skill Tree Skeleton Mock
Overview
The capability-skeleton-mock crate provides an advanced mock-up framework for constructing complex hierarchical structures, or skeletons, with different node types. Primarily designed for testing and simulation, it facilitates the creation and management of tree-like data models with configurable node attributes.
Key Features
- Node Variety: Supports aggregate, dispatch, and leaf node types, each configurable with unique identifiers and properties.
- Skeleton Construction: Build skeletons programmatically, specifying parameters such as the node count, hierarchical depth, and node kind distributions.
- Randomized and Structured Skeletons: Offers both deterministic and stochastic approaches to skeleton creation, ensuring flexibility in test scenarios.
- Breadth-First Traversal: Enables robust simulation of tree navigation through BFS (Breadth-First Search), supporting advanced configurations like custom leaf counts and multilevel linkages.
Usage
Below is an example of creating a structured skeleton with dispatch and leaf nodes, demonstrating the crate's core functionality:
use capability_skeleton_mock::{make_dispatch_node, make_leaf_node, SkeletonBuilder};
fn main() {
let n0 = make_dispatch_node(0, &[1, 2]);
let n1 = make_leaf_node(1);
let n2 = make_leaf_node(2);
let skeleton = SkeletonBuilder::default()
.nodes(vec![n0, n1, n2])
.root_id(Some(0))
.build()
.unwrap();
// Use skeleton in simulations...
}
Technical Insights
This crate employs advanced traversal techniques and depth management to facilitate stress-testing of hierarchical data. It supports BFS logic, enabling robust navigation and manipulation of branches and leaves.
Contributing
Contributions, bug reports, and feature requests are welcome. Please feel free to open issues or submit pull requests.
License
This project is licensed under the GPL-3.0 License.
This README.md was generated by an AI model and may not be 100% accurate; however, it should be pretty good.
Dependencies
~48–91MB
~1.5M SLoC