aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/renderer/structural/structural_data.rs
blob: 583808cd931bd01f87821d0ec329ca902d058cf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use serde::Serialize;

use crate::ProgramCollect;

/// Marker trait for types that support structured output (JSON / YAML / TOML / RON).
///
/// This trait is a **supertrait** of `serde::Serialize` and is sealed via
/// `__private::StructuralDataSealed`. It can only be implemented through:
///
/// - `#[derive(StructuralData)]`
/// - `pack_structural!`
/// - `group_structural!`
///
/// These entry points also register the type in the global `STRUCTURED_TYPES`
/// registry, which is required for the `structural_render` match arm to be generated.
#[doc(hidden)]
pub trait StructuralData<C>: Serialize + crate::__private::StructuralDataSealed<C>
where
    C: ProgramCollect<Enum = C>,
{
}