Skip to main content

scan_wordprocessing_part_with

Function scan_wordprocessing_part_with 

Source
pub fn scan_wordprocessing_part_with(
    xml: &[u8],
    limits: ScanLimits,
    sink: impl FnMut(TextBlock) -> Result<(), ScanError>,
) -> Result<PartCoverage, ScanError>
Expand description

Scan one WordprocessingML part and deliver completed blocks in document order without retaining a second whole-part block collection.

A sink may observe blocks before the scanner reaches a later malformed element. Callers that require atomic behavior must stage sink output until this function returns successfully.

The input boundary is deliberately UTF-8. DOCX producers conventionally store WordprocessingML parts as UTF-8; callers with another XML encoding must transcode before scanning.

ยงErrors

Returns ScanError when the XML is malformed, violates a configured resource bound, contains text in an invalid location, or the sink rejects a block.