capability-crate-writer

Crates.iocapability-crate-writer
lib.rscapability-crate-writer
version0.1.0
created_at2025-07-13 21:49:03.31633+00
updated_at2025-07-13 21:49:03.31633+00
descriptionA Rust crate facilitating generation of Rust crate text for dynamic skill trees, supporting dispatch, aggregate, and leaf holder nodes with customizable descriptors.
homepage
repository
max_upload_size
id1750842
size229,408
(klebs6)

documentation

README

Grower Skill Tree Crate Writer

Grower Skill Tree Crate Writer is a Rust crate that provides a flexible interface for generating skill trees in the form of Rust code. This facility is particularly useful for applications requiring hierarchical data structures, such as game development, simulations, and various modeling tasks.

Overview

This crate defines the SkillTreeCrateWriter trait, which allows the implementation of components capable of outputting Rust crate text that represents different node types: dispatch, aggregate, and leaf holder nodes.

Key Features

  • Dispatch Nodes: These are modeled as enums that select one of several child nodes, each represented as a variant.
  • Aggregate Nodes: Represented as structs, each with fields corresponding to child nodes. Optional fields are wrapped in Option types, and children probabilities are annotated for construction logic.
  • Leaf Holder Nodes: Enums with variants for each leaf, allowing descriptor annotation via an AI-inspired attribute.

Error Handling

The crate provides a simple error representation via the GrowerModelWriteSkillTreeError enum, facilitating straightforward error management within skill tree generation processes.

Usage Example

Here's a simple example demonstrating how to use the SkillTreeCrateWriter trait:

use capability_crate_writer::{SkillTreeCrateWriter, GrowerModel, GrowerModelWriteSkillTreeError};

impl SkillTreeCrateWriter for GrowerModel {
    type Error = GrowerModelWriteSkillTreeError;

    fn skill_tree_write_crate_text(&self) -> Result<String, Self::Error> {
        // Implementation goes here.
    }
}

Getting Started

Add the following to your Cargo.toml:

[dependencies]
capability-crate-writer = "0.1.0"

Contributing

Contributions are welcome. Please follow the standard Rust guidelines for greater consistency and quality.

License

This project is licensed under the terms of the GPL-3.0 license.

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

Commit count: 0

cargo fmt