Skip to main content

stream_search

Function stream_search 

Source
pub fn stream_search(
    index: &Index,
    root: &Path,
    pattern: &str,
    opts: SearchOptions,
    emit: impl FnMut(&[u8]) -> Result<()>,
) -> Result<()>
Expand description

Stream a content search against a (ready) index, emitting path:line:text chunks via emit.

One path for everything: the index turns the pattern into a candidate file set (a precise subset for trigram-accelerable patterns, or every file for a fallback pattern with no usable trigram), and ripgrep confirms over exactly that set. There is no separate “scan the tree” branch.