Skip to main content

expand_struct

Function expand_struct 

Source
fn expand_struct(
    attr: TokenStream,
    item: TokenStream,
    item_struct: &ItemStruct,
) -> TokenStream
Expand description

Dispatches #[miniextendr] on a struct to the correct derive path.

Decision logic:

  • 1-field struct with ALTREP attrs (class/base): compile error with migration guidance (ALTREP via #[miniextendr] is removed — use the #[derive(Altrep*)] family)
  • Explicit list mode: IntoList + TryFromList + PreferList
  • Explicit dataframe mode: IntoList + DataFrameRow + companion IntoR
  • Default multi-field or explicit externalptr: ExternalPtr
  • prefer = "native": ExternalPtr (without the IntoExternalPtr marker, #1283) + PreferRNativeType marker