Skip to main content

write_csv_aggregate

Function write_csv_aggregate 

Source
pub fn write_csv_aggregate<'a, W, I>(spaces: I, writer: W) -> Result<()>
where W: Write, I: IntoIterator<Item = (&'a FuncSpace, &'a Path)>,
Expand description

Write multiple metric trees into ONE CSV document under a single shared header row.

write_csv emits CSV_HEADER on every call, so concatenating its output for several files would repeat the header before each file’s rows — a structurally invalid CSV that downstream parsers ingest as data. This emits the header exactly once, then every file’s rows, for the --output <FILE> aggregate path (#669). A non-UTF-8 source path skips that file’s rows with a stderr warning, matching write_csv.

§Errors

Returns any io::Error surfaced by the underlying csv::Writer.