handle_value

Function handle_value 

Source
pub(crate) extern "C" fn handle_value(
    obs_index: c_int,
    variable: *mut readstat_variable_t,
    value: readstat_value_t,
    ctx: *mut c_void,
) -> c_int
Expand description

FFI callback that extracts a single cell value during row parsing.

Called for every cell in every row. Appends the value directly into the appropriate typed Arrow ColumnBuilder in ReadStatData::builders, eliminating intermediate String allocations for string columns. Tracks row completion for progress reporting.

ยงSafety

  • variable must be a valid pointer to a readstat_variable_t produced by the C parser.
  • value must be a valid readstat_value_t produced by the C parser.
  • ctx must be a valid pointer to a ReadStatData instance that outlives this call.
  • This function must only be called by the ReadStat C library as a registered callback.