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_core/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mingling_core/src/lib.rs') diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs index ddb5446..9d0ac2a 100644 --- a/mingling_core/src/lib.rs +++ b/mingling_core/src/lib.rs @@ -22,6 +22,9 @@ pub mod test { #[cfg(feature = "general_renderer")] pub use crate::renderer::general::GeneralRenderer; +// NOT re-exported at top level: the `StructuralData` trait is sealed and only +// accessible through the derive macro. Users who need the trait can access it +// via `mingling::renderer::general::StructuralData` (through the inner alias). pub use crate::any::group::*; pub use crate::any::*; @@ -72,6 +75,18 @@ pub mod setup { pub use crate::program::setup::ProgramSetup; } +/// Private API — not intended for direct use. +#[doc(hidden)] +pub mod __private { + /// Sealed trait for `StructuralData` — only implementable via derive macro. + pub trait StructuralDataSealed {} + + /// Re-export so the derive macro can reference the trait without + /// conflicting with the derive macro name at `::mingling::StructuralData`. + #[cfg(feature = "general_renderer")] + pub use crate::renderer::general::structural_data::StructuralData; +} + #[doc(hidden)] pub mod core_res { #[cfg(feature = "repl")] -- cgit