pub fn write_csv(
sheet: &Sheet,
delimiter: u8,
cell_text: impl FnMut(CellRef) -> String,
) -> Result<Vec<u8>, IoError>Expand description
Writes the sheet as CSV from A1 to the end of its used range, so leading empty columns and rows
stay as empty fields and every cell keeps its position (CRLF line ends, UTF-8 without BOM). cell_text gives
each cell’s field text: the caller decides how values look (Save As CSV writes them as
displayed, number formats applied); quoting is done here.
The output is capped at MAX_CSV_BYTES: a cell far from A1 makes the file as big as the whole
rectangle between them (A1 and XFD1048576 are 16 GiB of commas).
An export that would pass the cap is refused before anything is allocated, or at the first
field or line end that takes it past the cap (a field is measured before it is written), with
IoError::TooLarge; accepted exports keep every field in its place.