Expand description
A fast, low-allocation library for writing XLSX (Excel Open XML) files.
excel-rs-xlsx streams cell data directly into a ZIP-compressed XLSX
archive, flushing to the underlying writer in batches. It never
materialises the full file in memory, which makes it suitable for large
datasets.
§Quick start
use std::fs::File;
use excel_rs::{WorkBook, sheet::CellType};
let file = File::create("output.xlsx").unwrap();
let mut wb = WorkBook::new(file);
let mut sheet = wb.new_worksheet("Sales".to_string()).unwrap();
sheet.write_row([b"Name".as_ref(), b"Revenue"].into_iter(), None).unwrap();
sheet.write_row([b"Alice".as_ref(), b"42000"].into_iter(), Some(&[CellType::String, CellType::Number])).unwrap();
sheet.close().unwrap();
wb.finish().unwrap();§Limits
These match the OOXML / Excel specification:
| Limit | Value |
|---|---|
| Rows per sheet | 1 048 576 |
| Columns per sheet | 16 384 |
| Sheets per workbook | 65 535 |
Re-exports§
pub use error::ExcelError;pub use error::Result;pub use workbook::WorkBook;
Modules§
Constants§
- MAX_
COLS - Maximum number of columns per worksheet (Excel limit).
- MAX_
ROWS - Maximum number of rows per worksheet (Excel limit).
- MAX_
SHEETS - Maximum number of worksheets per workbook (Excel limit).