Expand description
Recursive search for datasets below a directory.
The home screen’s filter is a fuzzy match over rows that are already listed. This module is what puts more rows in front of it: one bounded walk of the working directory, run once in the background, whose result is then filtered in memory like everything else. Nothing here is repeated per keystroke — a walk per character is how a file finder becomes slow on exactly the trees where it matters.
Every limit exists because some real directory violates it. See [Limits].
The walk keeps every data file it finds, and the filter is scored against that
index off the UI thread (score). The cap on what is listed counts matches, not
files: a file that matches is never lost behind thousands that do not.
Structs§
- Matches
- What the filter matched among the files a walk kept.
- Outcome
- How far a walk got, and why it stopped.
Constants§
- MAX_
INDEXED - The most files one walk keeps. The time budget bounds a walk first in practice; this bounds its memory on a tree fast enough to list a million names inside it.
Functions§
- score
- Score
queryagainst the files inindex, keeping the bestlimitto list. - search_
root - Where a search should start, given where the user is.
- walk
- Walk
rootfor datasets, handing batches toemitas they are found. - walk_
up_ to walk, keeping at mostcapfiles.- walk_
with_ specs walk, keeping the filesformatsreads as well, as the listing names them: by a spec’s glob, or by its magic in the first bytes of a file whose name says nothing, at most [crate::discover::MAX_SNIFFS_PER_DIR] of them a directory.