Skip to main content

derive_struct_dataframe

Function derive_struct_dataframe 

Source
fn derive_struct_dataframe(
    row_name: &Ident,
    input: &DeriveInput,
    data: &DataStruct,
    df_name: &Ident,
    attrs: &DataFrameAttrs,
) -> Result<TokenStream>
Expand description

Generate DataFrameRow expansion for struct types.

Produces:

  • A companion struct {Name}DataFrame with Vec<T> columns
  • impl IntoDataFrame for {Name}DataFrame
  • impl From<Vec<{Name}>> for {Name}DataFrame
  • impl IntoIterator (for named structs without expansion)
  • Associated methods: to_dataframe, from_dataframe, from_rows, from_rows_par
  • A compile-time IntoList assertion (for non-expanded named structs)

Handles fixed-array expansion ([T; N]), pinned-width Vec expansion (Vec<T> + width), and auto-expand Vec (Vec<T> + expand).