Skip to main content

enum_field_reader_capable

Function enum_field_reader_capable 

Source
fn enum_field_reader_capable(erf: &EnumResolvedField) -> bool
Expand description

Check whether an enum field is reader-capable.

Mirrors field_reader_capable from dataframe_derive.rs but for EnumResolvedField. Key differences vs the struct path:

  • Single enum fields are always Vec<Option<ty>> (even non-factor) because the writer wraps every cell in Option; so we only need is_reader_scalar_ty (which accepts both bare scalars and Option<scalar>).
  • is_factor Single fields are reader-capable iff the inner type satisfies UnitEnumFactor — guaranteed by the derive for unit-only enums.
  • Map fields are reader-capable iff both K and V are bare scalar element types: the reader regroups the <base>_keys / <base>_values list-columns (each row a Vec<K> / Vec<V>) back into the map via Vec<elem>: TryFromSexp. Option-wrapped key/value element types are excluded (the writer emits them, but the reader path is restricted to the round-trippable bare-scalar set).