Skip to main content

Module stream

Module stream 

Source
Expand description

Streaming worksheet writer.

The StreamWriter builds WorksheetXml structs directly instead of writing raw XML text. 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();
let xml_bytes = sw.finish().unwrap();
assert!(!xml_bytes.is_empty());

Structs§

StreamRowOptions
Options for a streamed row.
StreamWriter
A streaming worksheet writer that writes rows sequentially.