pub struct StreamWriter { /* private fields */ }Expand description
A streaming worksheet writer that writes rows sequentially.
Rows must be written in ascending order. The StreamWriter builds
Row structs directly, then assembles them into a WorksheetXml
on finish.
Implementations§
Source§impl StreamWriter
impl StreamWriter
Sourcepub fn sheet_name(&self) -> &str
pub fn sheet_name(&self) -> &str
Get the sheet name.
Sourcepub fn set_col_width(&mut self, col: u32, width: f64) -> Result<()>
pub fn set_col_width(&mut self, col: u32, width: f64) -> Result<()>
Set column width for a single column (1-based). Must be called before any write_row() calls.
Sourcepub fn set_col_width_range(
&mut self,
min_col: u32,
max_col: u32,
width: f64,
) -> Result<()>
pub fn set_col_width_range( &mut self, min_col: u32, max_col: u32, width: f64, ) -> Result<()>
Set column width for a range (min_col..=max_col), both 1-based. Must be called before any write_row() calls.
Sourcepub fn set_col_style(&mut self, col: u32, style_id: u32) -> Result<()>
pub fn set_col_style(&mut self, col: u32, style_id: u32) -> Result<()>
Set column style for a single column (1-based). Must be called before any write_row() calls.
Sourcepub fn set_col_visible(&mut self, col: u32, visible: bool) -> Result<()>
pub fn set_col_visible(&mut self, col: u32, visible: bool) -> Result<()>
Set column visibility for a single column (1-based). Must be called before any write_row() calls.
Sourcepub fn set_col_outline_level(&mut self, col: u32, level: u8) -> Result<()>
pub fn set_col_outline_level(&mut self, col: u32, level: u8) -> Result<()>
Set column outline level for a single column (1-based). Must be called before any write_row() calls. Level must be 0-7.
Sourcepub fn set_freeze_panes(&mut self, top_left_cell: &str) -> Result<()>
pub fn set_freeze_panes(&mut self, top_left_cell: &str) -> Result<()>
Set freeze panes for the streamed sheet.
Must be called before any write_row() calls.
top_left_cell is the cell below and to the right of the frozen area,
e.g., “A2” freezes row 1, “B1” freezes column A, “C3” freezes rows 1-2
and columns A-B.
Sourcepub fn write_row_with_options(
&mut self,
row: u32,
values: &[CellValue],
options: &StreamRowOptions,
) -> Result<()>
pub fn write_row_with_options( &mut self, row: u32, values: &[CellValue], options: &StreamRowOptions, ) -> Result<()>
Write a row of values with row-level options.
Sourcepub fn write_row(&mut self, row: u32, values: &[CellValue]) -> Result<()>
pub fn write_row(&mut self, row: u32, values: &[CellValue]) -> Result<()>
Write a row of values. Rows must be written in ascending order. Row numbers are 1-based.
Sourcepub fn write_row_with_style(
&mut self,
row: u32,
values: &[CellValue],
style_id: u32,
) -> Result<()>
pub fn write_row_with_style( &mut self, row: u32, values: &[CellValue], style_id: u32, ) -> Result<()>
Write a row with a specific style ID applied to all cells.
Sourcepub fn add_merge_cell(&mut self, reference: &str) -> Result<()>
pub fn add_merge_cell(&mut self, reference: &str) -> Result<()>
Add a merge cell reference (e.g., “A1:B2”). Must be called before finish(). The reference must be a valid range in the form “A1:B2”.
Sourcepub fn finish(&mut self) -> Result<Vec<u8>>
pub fn finish(&mut self) -> Result<Vec<u8>>
Finish writing and return the complete worksheet XML bytes.
Sourcepub fn sst(&self) -> &SharedStringTable
pub fn sst(&self) -> &SharedStringTable
Get a reference to the shared string table.
Sourcepub fn into_parts(self) -> Result<(Vec<u8>, SharedStringTable)>
pub fn into_parts(self) -> Result<(Vec<u8>, SharedStringTable)>
Consume the writer and return (xml_bytes, shared_string_table).
Sourcepub fn into_worksheet_parts(self) -> Result<(WorksheetXml, SharedStringTable)>
pub fn into_worksheet_parts(self) -> Result<(WorksheetXml, SharedStringTable)>
Consume the writer and return the worksheet XML struct and shared string table. This is the optimized path that avoids XML serialization/deserialization.