aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-26 11:49:35 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-26 11:49:35 +0800
commite4287454b9d514b1fb5eacd755a32cf562458ae3 (patch)
treeb04794141dc2f5d64ab73f7503879a9a4914a91b
parentc8c82691115892581b7cc462701c2e01c0c5e435 (diff)
feat(macros, docs): register structural macros and update feature table
-rw-r--r--mingling_macros/src/lib.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs
index fdc2aaa..21273ba 100644
--- a/mingling_macros/src/lib.rs
+++ b/mingling_macros/src/lib.rs
@@ -51,8 +51,12 @@
//! | [`macro@dispatcher_clap`] | Like `dispatcher!` but powered by `clap::Parser` |
//! | [`node!`] | Builds a [`Node`](https://docs.rs/mingling/latest/mingling/struct.Node.html) from a dot-separated path string |
//! | [`pack!`] | Creates a newtype wrapper around an inner type for use in Chain/Renderer |
+//! | [`pack_structural!`] | Like `pack!` but also derives `StructuralData` for structured output |
+//! | [`pack_err!`] | Creates an error struct with automatic `name` field |
+//! | [`pack_err_structural!`] | Like `pack_err!` but also derives `StructuralData` for structured output |
//! | [`entry!`] | Creates a packed entry from string literals |
//! | [`#[derive(Groupped)]`](derive@Groupped) | Makes a type recognizable by the framework's type registry |
+//! | [`#[derive(StructuralData)]`](derive@StructuralData) | Marks a type as eligible for structured output (JSON/YAML/etc.) |
//! | [`#[derive(EnumTag)]`](derive@EnumTag) | Adds enum variant metadata (name, description) |
//!
//! ## Phase 2: Processing & Rendering Registration
@@ -97,9 +101,10 @@
//! |---------|---------------|
//! | `clap` | [`macro@dispatcher_clap`] |
//! | `comp` | [`#[completion]`](attr.completion.html), [`suggest!`], [`suggest_enum!`] |
-//! | `extra_macros` | [`entry!`], [`empty_result!`], [`route!`], [`#[program_setup]`](attr.program_setup.html) |
+//! | `extra_macros` | [`entry!`], [`empty_result!`], [`route!`], [`#[program_setup]`](attr.program_setup.html), [`macro@group`] |
//! | `dispatch_tree` | `register_dispatcher!` (enables trie-based command dispatch) |
-//! | `structural_renderer` | Enables JSON/YAML/TOML/RON serialization renderers |
+//! | `structural_renderer` | [`#[derive(StructuralData)]`](derive@StructuralData), [`pack_structural!`], [`pack_err_structural!`], [`macro@group_structural`] |
+//! | `structural_renderer` + `extra_macros` | [`group_structural!`], [`pack_err_structural!`] |
//! | `async` | Enables async `#[chain]` functions |
//! | `repl` | Enables REPL execution loop |
//!
@@ -128,6 +133,9 @@
//! fn has_renderer(any: &AnyOutput) -> bool {
//! match any.member_id() {
//! MyType => true, // ← collected from #[renderer] macros
+//! // When `structural_renderer` is enabled, ALL registered types
+//! // return true — non-structural types fall through to render
+//! // a `ResultEmpty` value (via structural_render fallback).
//! _ => false,
//! }
//! }