Expand description
CLI dispatch logic for the readstat binary.
StructsΒ§
- Indicatif
Progress π ProgressCallbackimplementation backed by anindicatif::ProgressBar.- Reader
Config π - Inputs to the reader thread spawned by
run_data. - Write
Context π - State shared by every write strategy in
run_data.
ConstantsΒ§
- CHANNEL_
CAPACITY π - Capacity of the bounded channel between reader and writer threads. Also used as the batch size for bounded-batch parallel writes.
- STREAM_
ROWS π - Default number of rows to read per streaming chunk.
FunctionsΒ§
- create_
progress π - Create a progress bar if progress is enabled.
- format_
with_ πcommas - Formats a number with comma thousands separators (e.g. 1081 -> β1,081β).
- join_
reader π - Joins the reader thread, surfacing either its internal error or a panic.
- print_
write_ πsummary - Prints the βwrote N rowsβ summary. The library no longer prints this; the CLI owns all user-facing output.
- resolve_
columns π - Resolve column names from
--columnsor--columns-fileCLI options. - resolve_
stream_ πrows - Determine stream row count based on reader type.
- run
- Executes the CLI command specified by the parsed
ReadStatCliarguments. - run_
data π - Handle the
datasubcommand: read SAS data and write to an output file. - run_
metadata π - Handle the
metadatasubcommand: read and display SAS file metadata. - run_
preview π - Handle the
previewsubcommand: read a limited number of rows and write to stdout as CSV. - spawn_
reader π - Spawns the reader thread that parses row chunks and sends them to
sender. - write_
empty_ πoutput - Writes a valid empty output file (header-only CSV, empty Parquet/Feather/ NDJSON) when the input contributed zero rows. Without this, a zero-row input would produce no output file at all despite a success exit code.
- write_
parallel_ πparquet - Parallel Parquet write path (only for
--parallel --parallel-writewith Parquet output): write each buffered batch group to a temp file concurrently, then merge the temp files into the final output. - write_
sequential π - Default write path: consume chunks in order, streaming each to the format
writer, then finalize. Memory stays bounded because only the most recent
chunk is retained β kept solely so
finishcan report the row total.