Skip to main content

generate_split_method

Function generate_split_method 

Source
fn generate_split_method(
    row_name: &Ident,
    variant_infos: &[VariantInfo],
    impl_generics: &ImplGenerics<'_>,
    ty_generics: &TypeGenerics<'_>,
    where_clause: Option<&WhereClause>,
) -> TokenStream
Expand description

Generate the split representation for an enum DataFrameRow: the hidden to_dataframe_split associated method (body holder) plus the DataFrameRowSplit bridge impl that surfaces the public rows.into_dataframe_split() verb (IntoDataFrameSplit).

For a single-variant enum, returns the data.frame directly. For multi-variant enums, returns a named R list of data.frames (one per variant, named with snake_case variant names). Each partition data.frame has only that variant’s columns (non-optional types — no NA fill from other variants).