Skip to main content

Module enum_expansion

Module enum_expansion 

Source
Expand description

Enum-specific DataFrame derive expansion.

Generates a companion struct where every column is Vec<Option<T>>, with None fill for fields absent in a given variant.

Functionsยง

build_enum_reader ๐Ÿ”’
Build the try_from_dataframe / try_from_dataframe_par methods for a tagged enum.
derive_enum_dataframe ๐Ÿ”’
Derive DataFrameRow for an enum with #[dataframe(align)].
enum_elem_idents ๐Ÿ”’
The variables an expanded fieldโ€™s elements are bound to, for the field at pos in its variant: by position, since all of a variantโ€™s fields are bound before any column is filled.
enum_field_reader_capable ๐Ÿ”’
Check whether an enum field is reader-capable.
enum_reader_field_value ๐Ÿ”’
The value of field erf in row __i of variant variant_name_str, read from the readerโ€™s extracted columns. With take, each cell is moved out of its column: the sequential reader owns the columns and visits each row once. Without it, the cell is cloned: the parallel reader shares the columns across threads, and reads only scalar columns, which are all Clone.
expanded_elem_prelude ๐Ÿ”’
Bind the elements of variant viโ€™s [T; N] / width = N fields to the variables enum_elem_idents names, for a match arm whose pattern binds each field to its binding.
generate_split_method ๐Ÿ”’
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).
option_scalar_in_variant_error ๐Ÿ”’
Error for an Option<scalar> field inside an enum variant (#1437).
raw_variant_column_error ๐Ÿ”’
Reject u8 in every variant-field shape that reaches a column: a scalar or Option<u8>, a fixed array, or a width / expand (padded) slice. Variant columns are NA in rows of the other variants, and R raw vectors have no NA. A plain Vec<u8> stays an opaque list-column and is accepted.