Expand description
The in-process corpus engine.
Search uses ripgrep’s own crates (grep, ignore, globset) linked
directly into the process — the same matching/walking engine as the rg
binary, but with no subprocess and therefore no shell-injection surface.
All functions here are synchronous and blocking; callers on an async runtime
should dispatch them via spawn_blocking (the tool layer does this).
Structs§
- DirEntry
Info - A directory entry returned by
list_dir. - Find
Query - Parameters for a
findcall. - Find
Result - Result of a
findcall. - List
Result - Result of a
list_dircall. - Numbered
Line - A numbered line returned by
read_range. - Read
Result - Result of a
read_rangecall. - Search
Hit - A single line emitted by
search, either a match or surrounding context. - Search
Query - Parameters for a
searchcall. - Search
Result - Result of a
searchcall.
Functions§
- find
- Find files whose corpus-relative path matches a glob.
- list_
dir - List the immediate entries of a directory inside the corpus.
- list_
files - Enumerate every file in the corpus as a corpus-relative path, honoring the
walk limits (gitignore, hidden,
max_files_walked). - read_
document - Read a whole file (bounded by
max_file_bytes) as UTF-8 (lossy), resolving the path through the corpus jail. - read_
range - Read a bounded, line-numbered window from a single file.
- search
- Run a regular-expression search across the corpus.