aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/lib.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_core/src/lib.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_core/src/lib.rs')
-rw-r--r--mingling_core/src/lib.rs15
1 files changed, 15 insertions, 0 deletions
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")]