Skip to main content

assert_no_payload_field_collision

Function assert_no_payload_field_collision 

Source
#[doc(hidden)]
pub const fn assert_no_payload_field_collision( fields: &[&str], discriminant_suffix: &str, )
Expand description

Compile-time assertion: no element of fields equals discriminant_suffix (the inner-enum’s #[dataframe(tag)] value).

Called from const _: () blocks emitted by the outer DataFrameRow derive for every EnumResolvedField::Struct nested-enum field:

const _: () = ::miniextendr_api::markers::assert_no_payload_field_collision(
    <Inner as ::miniextendr_api::markers::DataFramePayloadFields>::FIELDS,
    <Inner as ::miniextendr_api::markers::DataFramePayloadFields>::TAG,
);

fields contains the resolved column names the inner type emits directly (not prefixed). discriminant_suffix is the inner enum’s tag value (e.g. "variant").

If any field name equals the discriminant suffix, the const evaluation panics with a message explaining the collision and suggesting a rename.