Skip to main content

Module streaming

Module streaming 

Source
Expand description

Streaming API for fuzzy regex matching.

This module provides types for processing text streams incrementally, allowing fuzzy regex matching on large files, network streams, or any byte source without loading everything into memory.

§Example

use fuzzy_regex::FuzzyRegex;

let re = FuzzyRegex::new("(?:hello){e<=1}").unwrap();
let mut stream = re.stream();

// Feed chunks of data
let chunk1 = b"This is a test with hel";
let chunk2 = b"lo world in it";

for m in stream.feed(chunk1) {
    println!("Match at {}-{}", m.start(), m.end());
}
for m in stream.feed(chunk2) {
    println!("Match at {}-{}", m.start(), m.end());
}

// Finish processing to get any remaining matches
if let Some(m) = stream.finish() {
    println!("Final match at {}-{}", m.start(), m.end());
}

Structs§

ByteMatches
Iterator over matches in a byte slice (non-streaming).
FeedMatches
Iterator over matches from a single feed() call.
ReaderMatches
Iterator over matches from a reader.
StreamingMatch
A match found during streaming search.
StreamingMatcher
A streaming matcher for incremental fuzzy regex matching.