#[non_exhaustive]pub struct Limits {Show 16 fields
pub max_input_bytes: u64,
pub max_units: usize,
pub max_unit_chars: usize,
pub max_lines: usize,
pub max_xml_depth: usize,
pub max_xml_elements: usize,
pub max_zip_entries: usize,
pub max_zip_bytes: u64,
pub max_zip_entry_bytes: u64,
pub max_zip_ratio: u64,
pub zip_ratio_floor_bytes: u64,
pub max_paragraphs: usize,
pub xlsx_max_cells: usize,
pub xlsx_max_rows: u32,
pub xlsx_max_cell_chars: usize,
pub xlsx_max_total_text_chars: usize,
}Expand description
The limits one extraction runs under. Default is Localization OS’s configuration.
Build them with Limits::new and the with_* methods (Limits::new().with_max_units(500)); new limits are
added without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_input_bytes: u64Largest input file (MAX_UPLOAD_BYTES).
max_units: usizeMost units (and most segments) in a document (MAX_DOCUMENT_SEGMENTS).
max_unit_chars: usizeMost characters in one unit (MAX_SEGMENT_CHARS).
max_lines: usizeMost lines in a text file: twenty per allowed unit, as LocOS’s line budget.
max_xml_depth: usizeDeepest XML element nesting (libxml2’s own default).
max_xml_elements: usizeMost XML elements in one part.
max_zip_entries: usizeMost entries in a zip (ZIP_MAX_MEMBERS).
max_zip_bytes: u64Most bytes all entries of a zip unpack to (ZIP_MAX_UNCOMPRESSED_BYTES).
max_zip_entry_bytes: u64Most bytes one zip entry may unpack to. LocOS has no cap of its own beyond the total, so the default is the same 256 MB; a caller may set it lower (or raise both for desktop use).
max_zip_ratio: u64Largest unpacked/packed ratio of one entry (ZIP_MAX_RATIO).
zip_ratio_floor_bytes: u64Entries smaller than this are not checked for ratio (ZIP_RATIO_MIN_BYTES).
max_paragraphs: usizeMost paragraphs in a DOCX, empty ones included (DOCX_MAX_PARAGRAPHS).
xlsx_max_cells: usizeMost cells in an XLSX (XLSX_MAX_CELLS).
xlsx_max_rows: u32Highest row number in an XLSX (XLSX_MAX_ROWS).
xlsx_max_cell_chars: usizeMost characters in one XLSX cell or shared string (XLSX_MAX_CELL_CHARS, Excel’s own limit).
xlsx_max_total_text_chars: usizeMost characters of cell text in an XLSX, repeated shared strings counted every time
(XLSX_MAX_TOTAL_TEXT_CHARS).
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn new() -> Limits
pub fn new() -> Limits
Localization OS’s limits (the same as Limits::default()); change any of them with the with_* methods.
Sourcepub fn with_max_input_bytes(self, v: u64) -> Limits
pub fn with_max_input_bytes(self, v: u64) -> Limits
Sets max_input_bytes.
Sourcepub fn with_max_units(self, v: usize) -> Limits
pub fn with_max_units(self, v: usize) -> Limits
Sets max_units.
Sourcepub fn with_max_unit_chars(self, v: usize) -> Limits
pub fn with_max_unit_chars(self, v: usize) -> Limits
Sets max_unit_chars.
Sourcepub fn with_max_lines(self, v: usize) -> Limits
pub fn with_max_lines(self, v: usize) -> Limits
Sets max_lines.
Sourcepub fn with_max_xml_depth(self, v: usize) -> Limits
pub fn with_max_xml_depth(self, v: usize) -> Limits
Sets max_xml_depth.
Sourcepub fn with_max_xml_elements(self, v: usize) -> Limits
pub fn with_max_xml_elements(self, v: usize) -> Limits
Sets max_xml_elements.
Sourcepub fn with_max_zip_entries(self, v: usize) -> Limits
pub fn with_max_zip_entries(self, v: usize) -> Limits
Sets max_zip_entries.
Sourcepub fn with_max_zip_bytes(self, v: u64) -> Limits
pub fn with_max_zip_bytes(self, v: u64) -> Limits
Sets max_zip_bytes.
Sourcepub fn with_max_zip_entry_bytes(self, v: u64) -> Limits
pub fn with_max_zip_entry_bytes(self, v: u64) -> Limits
Sets max_zip_entry_bytes.
Sourcepub fn with_max_zip_ratio(self, v: u64) -> Limits
pub fn with_max_zip_ratio(self, v: u64) -> Limits
Sets max_zip_ratio.
Sourcepub fn with_zip_ratio_floor_bytes(self, v: u64) -> Limits
pub fn with_zip_ratio_floor_bytes(self, v: u64) -> Limits
Sets zip_ratio_floor_bytes.
Sourcepub fn with_max_paragraphs(self, v: usize) -> Limits
pub fn with_max_paragraphs(self, v: usize) -> Limits
Sets max_paragraphs.
Sourcepub fn with_xlsx_max_cells(self, v: usize) -> Limits
pub fn with_xlsx_max_cells(self, v: usize) -> Limits
Sets xlsx_max_cells.
Sourcepub fn with_xlsx_max_rows(self, v: u32) -> Limits
pub fn with_xlsx_max_rows(self, v: u32) -> Limits
Sets xlsx_max_rows.
Sourcepub fn with_xlsx_max_cell_chars(self, v: usize) -> Limits
pub fn with_xlsx_max_cell_chars(self, v: usize) -> Limits
Sets xlsx_max_cell_chars.
Sourcepub fn with_xlsx_max_total_text_chars(self, v: usize) -> Limits
pub fn with_xlsx_max_total_text_chars(self, v: usize) -> Limits
Sets xlsx_max_total_text_chars.