workspacer-consolidate

Crates.ioworkspacer-consolidate
lib.rsworkspacer-consolidate
version0.5.3
created_at2025-02-09 04:21:24.630682+00
updated_at2025-07-13 01:03:35.986351+00
descriptionAsynchronously consolidate and introspect Rust crate interfaces, gathering typical items within a unified system for enhanced analysis and modification.
homepage
repositoryhttps://github.com/klebs6/klebs-general
max_upload_size
id1548648
size463,731
(klebs6)

documentation

README

workspacer-consolidate

Overview

The workspacer-consolidate Rust crate offers a robust mechanism to assemble and manage consolidated representations of typical Rust code entities, such as functions, structs, enums, traits, type aliases, macros, modules, and implementation blocks, pulled together into a unified crate interface. By capturing these elements in a systematic way, developers can facilitate the introspection, documentation, and manipulation of code at a higher semantic level than mere text processing.

Our API leverages advanced paradigms of async processing using the async_trait for consolidated operations, allowing non-blocking management of crate interfaces.

Key Features

  • Consolidated Item Handling: Enumerates over nine primary consolidated Rust code entities
  • Async Trait Consolidation: Implements an asynchronous trait interface for consolidation operations
  • Comprehensive Filtering: Utilize ConsolidationOptions for specific content gathering including documentation, visibility restrictions, and test items
  • Item Collection and Signature Generation: Systems in place for the easy gathering of items and generation of syntactically correct signatures

Mathematical and Technical Concepts

  1. Collective Representation: Leveraging enum types to encapsulate variant forms of code constructs for ease of manipulation and display.
  2. Regular Expression Parsing: Employed in transforming documentation comments and attributes for improved legibility and uniformity.
  3. Abstract Syntax Tree (AST) Manipulation: Direct access and transformation of syntax nodes to enable fine-grained introspection and output formatting.
  4. Lazy Evaluation with Async: The asynchronous interfaces cater to efficient performance optimization via lazy evaluation, particularly under I/O-bound tasks during source retrieval operations.

Usage

To integrate workspacer-consolidate into your project, add it to your Cargo.toml:

[dependencies]
workspacer-consolidate = "0.5.0"

Utilize the crate by creating a custom struct that implements the ConsolidateCrateInterface trait, leveraging its methods in an async context for consolidating interface elements per provided options:

use workspacer_consolidate::{ConsolidatedCrateInterface, ConsolidationOptions};

async fn consolidate_interface() -> Result<ConsolidatedCrateInterface, workspacer_consolidate::CrateError> {
    let options = ConsolidationOptions::new()
        .with_docs()
        .with_private_items();

    // Assuming `my_crate` implements `ConsolidateCrateInterface`.
    my_crate.consolidate_crate_interface(&options).await
}

Contributions

Contributions are welcomed on our GitHub repository. Feel free to open issues or pull requests.

Commit count: 634

cargo fmt