From e735671acb3a81e1b7e334e56b9ef3963ba0c2fc Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 26 Jun 2026 06:08:12 +0800 Subject: 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`. --- mingling_macros/src/pack.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'mingling_macros/src/pack.rs') 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 { -- cgit