pub struct OpenOptions {
pub sheet_rows: Option<u32>,
pub sheets: Option<Vec<String>>,
pub max_unzip_size: Option<u64>,
pub max_zip_entries: Option<usize>,
pub limits: OpenLimits,
pub crypt_limits: CryptLimits,
pub vba_limits: VbaLimits,
pub read_mode: ReadMode,
pub aux_parts: AuxParts,
pub date_interpretation: DateInterpretation,
}Expand description
Options for controlling how a workbook is opened and parsed.
Resource dimensions use finite secure defaults. Read mode defaults to
Lazy and auxiliary parts default to Deferred.
Use the builder-style setter methods for convenience.
Fields§
§sheet_rows: Option<u32>Maximum number of rows to read per sheet. Rows beyond this limit are silently discarded during parsing.
sheets: Option<Vec<String>>Only parse sheets whose names are in this list. Sheets not listed
are represented as empty worksheets (their XML is not parsed).
None means parse all sheets.
max_unzip_size: Option<u64>Maximum total decompressed size of all ZIP entries in bytes.
Compatibility override for aggregate declared and actual ZIP bytes.
None uses the finite values in OpenLimits.
max_zip_entries: Option<usize>Maximum number of ZIP entries allowed.
Compatibility override for archive entry count.
None uses the finite value in OpenLimits.
limits: OpenLimitsIndependently configurable finite resource limits.
crypt_limits: CryptLimitsIndependently configurable finite encryption-container and KDF limits.
vba_limits: VbaLimitsIndependently configurable finite VBA project limits.
read_mode: ReadModeRead mode: Lazy (default) skips auxiliary parts for faster
read-only workloads; Eager parses everything; Stream is
reserved for future streaming reads.
aux_parts: AuxPartsControls when auxiliary parts are parsed.
date_interpretation: DateInterpretationControls how date-formatted number cells are returned. Defaults to
DateInterpretation::NumFmt, which matches how Excel authors
files in practice. Use DateInterpretation::CellType when you
want spec-literal behavior.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn sheet_rows(self, rows: u32) -> Self
pub fn sheet_rows(self, rows: u32) -> Self
Set the maximum number of rows to read per sheet.
Sourcepub fn sheets(self, names: Vec<String>) -> Self
pub fn sheets(self, names: Vec<String>) -> Self
Only parse sheets whose names are in this list.
Sourcepub fn max_unzip_size(self, size: u64) -> Self
pub fn max_unzip_size(self, size: u64) -> Self
Set the maximum total decompressed size in bytes.
Sourcepub fn max_zip_entries(self, count: usize) -> Self
pub fn max_zip_entries(self, count: usize) -> Self
Set the maximum number of ZIP entries.
Sourcepub fn max_outer_input_bytes(self, bytes: u64) -> Self
pub fn max_outer_input_bytes(self, bytes: u64) -> Self
Override the outer input byte limit for this open operation.
Sourcepub fn max_entry_declared_bytes(self, bytes: u64) -> Self
pub fn max_entry_declared_bytes(self, bytes: u64) -> Self
Override the declared byte limit for each archive entry.
Sourcepub fn max_entry_actual_bytes(self, bytes: u64) -> Self
pub fn max_entry_actual_bytes(self, bytes: u64) -> Self
Override the actual byte limit for each archive entry.
Sourcepub fn max_aggregate_declared_bytes(self, bytes: u64) -> Self
pub fn max_aggregate_declared_bytes(self, bytes: u64) -> Self
Override the aggregate declared archive byte limit.
Sourcepub fn max_aggregate_actual_bytes(self, bytes: u64) -> Self
pub fn max_aggregate_actual_bytes(self, bytes: u64) -> Self
Override the aggregate actual archive byte limit.
Sourcepub fn max_compression_ratio(self, ratio: u64) -> Self
pub fn max_compression_ratio(self, ratio: u64) -> Self
Override the per-entry expansion ratio limit.
Sourcepub fn compression_ratio_floor_bytes(self, bytes: u64) -> Self
pub fn compression_ratio_floor_bytes(self, bytes: u64) -> Self
Override the decompressed entry size at or below which the expansion
ratio is not enforced. 0 enforces the ratio for every entry.
Sourcepub fn max_xml_part_bytes(self, bytes: u64) -> Self
pub fn max_xml_part_bytes(self, bytes: u64) -> Self
Override the actual byte limit for each XML part.
Sourcepub fn max_retained_package_bytes(self, bytes: u64) -> Self
pub fn max_retained_package_bytes(self, bytes: u64) -> Self
Override the byte limit for raw package data retained after open.
Sourcepub fn crypt_limits(self, limits: CryptLimits) -> Self
pub fn crypt_limits(self, limits: CryptLimits) -> Self
Override encryption-container and password-derivation limits.
Sourcepub fn vba_limits(self, limits: VbaLimits) -> Self
pub fn vba_limits(self, limits: VbaLimits) -> Self
Override VBA project parsing limits.
Sourcepub fn read_mode(self, mode: ReadMode) -> Self
pub fn read_mode(self, mode: ReadMode) -> Self
Set the read mode. Lazy skips auxiliary parts for faster
read-only workloads. Stream is reserved for future use.
Sourcepub fn date_interpretation(self, interpretation: DateInterpretation) -> Self
pub fn date_interpretation(self, interpretation: DateInterpretation) -> Self
Set the date interpretation policy. When set to
DateInterpretation::NumFmt, number cells that carry a date
number format are returned as CellValue::Date instead of
CellValue::Number.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more