Skip to main content

Module streaming

Module streaming 

Source
Expand description

Streaming XML parsing. Streaming XML parser for handling large documents

This module provides memory-efficient streaming parsing for multi-gigabyte XML files. Instead of loading the entire document into memory, items are yielded incrementally.

§Features

  • Memory-efficient: Process files larger than available RAM
  • Incremental: Yields items as they’re parsed
  • Configurable: Adjustable buffer sizes and recursion limits
  • Type-safe: Returns Result for error handling

§Examples

use std::fs::File;
use hedl_xml::streaming::{from_xml_stream, StreamConfig};

let file = File::open("large.xml")?;
let config = StreamConfig::default();

for result in from_xml_stream(file, &config)? {
    match result {
        Ok(item) => println!("Processed: {:?}", item),
        Err(e) => eprintln!("Error: {}", e),
    }
}

Structs§

StreamConfig
Configuration for streaming XML parsing
StreamItem
An item yielded by the streaming parser
StreamPosition
Position information for progress tracking and error reporting
XmlStreamingParser
A streaming XML parser that yields items incrementally

Enums§

EntityPolicy
Policy for handling XML entities and DTDs

Functions§

from_xml_stream
Create a streaming XML parser from a reader