capability-skeleton

Crates.iocapability-skeleton
lib.rscapability-skeleton
version0.1.0
created_at2025-07-13 12:00:11.320143+00
updated_at2025-07-13 12:00:11.320143+00
descriptionA Rust library for managing and building complex hierarchical tree structures such as skill trees. Supports serialization, error handling, and deep tree metrics.
homepage
repository
max_upload_size
id1750421
size273,850
(klebs6)

documentation

README

Grower Skill Tree Skeleton

capability-skeleton is a Rust library designed to manage hierarchical data structures, particularly those that mimic skill trees or directed graphs. Its architecture allows for the flexible creation and manipulation of these trees with built-in safety and serialization features.

Features

  • Node Types: Handle different types of nodes (Dispatch, Aggregate, LeafHolder) with semantic roles.
  • Construction and Manipulation: Use a builder pattern to construct node hierarchies and adjust their parameters.
  • Traversal and Analysis: Employ BFS and DFS algorithms to measure balance, depth, density, breadth, and more.
  • Error Handling: Comprehensive error system for handling I/O and structural validation issues.
  • Serialization: Full support for saving and loading tree structures from TOML format.

Usage

Integrate the crate into your project by including it in your Cargo.toml dependency list:

[dependencies]
capability-skeleton = "0.1.0"

Here's a simple example demonstrating how to build and utilize a skill tree:

use capability_skeleton::{Skeleton, SkeletonNodeBuilder, NodeKind};

let mut builder = SkeletonNodeBuilder::default();
let node = builder.id(1).name("RootNode").build(NodeKind::Aggregate).unwrap();
// Initialize the Skeleton
let mut tree = Skeleton::default();
tree.nodes_mut().push(node);

// Add more nodes...

For comprehensive examples, refer to the documentation.

Concepts

  • Node Variants:

    • Dispatch: Used where a single branch among many is chosen.
    • Aggregate: Includes all sub-branches simultaneously.
    • LeafHolder: Terminal nodes that hold leaves without further branching.
  • Level Map Construction: Use BFS to determine node levels for visualization or metrics.

  • Tree Analysis Metrics: Including balance symmetry, depth, density, leaf granularity, and more.

This README was generated by an AI model and may not be 100% accurate, but it should be pretty good.

Commit count: 0

cargo fmt