aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/pack.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-26 06:08:12 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-26 06:08:12 +0800
commite735671acb3a81e1b7e334e56b9ef3963ba0c2fc (patch)
tree46562d6630bb1582b41b6741a7a4f482febf84da /mingling_macros/src/pack.rs
parent473cd8e575d03d8bd5439e81cb6835f56a1e964f (diff)
feat(core): decouple structured output from Groupped trait
Introduce `StructuralData` sealed trait and `pack_structural!` / `group_structural!` / `derive(StructuralData)` macros to control structured rendering separately from grouping. `Groupped` no longer requires `Serialize`.
Diffstat (limited to 'mingling_macros/src/pack.rs')
-rw-r--r--mingling_macros/src/pack.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/mingling_macros/src/pack.rs b/mingling_macros/src/pack.rs
index ffb07f2..5a6ccb0 100644
--- a/mingling_macros/src/pack.rs
+++ b/mingling_macros/src/pack.rs
@@ -34,7 +34,8 @@ pub fn pack(input: TokenStream) -> TokenStream {
let attrs = pack_input.attrs;
// Generate the struct definition
- #[cfg(not(feature = "general_renderer"))]
+ // Note: No longer derives Serialize under general_renderer.
+ // Use pack_structual! for structured output support.
let struct_def = quote! {
#(#attrs)*
pub struct #type_name {
@@ -42,15 +43,6 @@ pub fn pack(input: TokenStream) -> TokenStream {
}
};
- #[cfg(feature = "general_renderer")]
- let struct_def = quote! {
- #(#attrs)*
- #[derive(serde::Serialize)]
- pub struct #type_name {
- pub(crate) inner: #inner_type,
- }
- };
-
// Generate the new() method
let new_impl = quote! {
impl #type_name {