Module stream

Module stream 

Source
Expand description

Streaming worksheet writer.

The StreamWriter writes row data directly to a temporary file instead of accumulating it in memory. This enables writing sheets with millions of rows without holding the entire worksheet in memory.

Strings are written as inline strings (<is><t>...</t></is>) rather than shared string references, eliminating the need for SST index remapping and allowing each row to be serialized independently.

Rows must be written in ascending order.

§Example

use sheetkit_core::stream::StreamWriter;
use sheetkit_core::cell::CellValue;

let mut sw = StreamWriter::new("Sheet1");
sw.set_col_width(1, 20.0).unwrap();
sw.write_row(1, &[CellValue::from("Name"), CellValue::from("Age")]).unwrap();
sw.write_row(2, &[CellValue::from("Alice"), CellValue::from(30)]).unwrap();
// StreamWriter data is applied to a workbook via apply_stream_writer().

Structs§

StreamRowOptions
Options for a streamed row.
StreamWriter
A streaming worksheet writer that writes rows directly to a temp file.
StreamedSheetData
Metadata for a streamed sheet stored in the workbook after applying.