Expand description
Recursive search for datasets below a directory: one bounded background walk of the
working directory, its results filtered in memory like listed rows; nothing repeats
per keystroke. Every limit exists because some real directory needs it (see
Limits). The walk keeps every data file, scored off the UI thread (score); the
listing cap counts matches, so a match is never lost behind non-matches.
Structs§
- Matches
- What the filter matched among the files a walk kept.
- Outcome
- How far a walk got and why it stopped: “not found here” is acted on, so a short search must say it was short.
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
queryagainstindex, keeping the bestlimit. Withbasefrom a prefix ofquery, only its matches and newer files are scored. Off the UI thread: on a large tree this made every keystroke wait. - search_
root - Where a search should start from where the user is;
Nonewithout a working directory or on a filesystem that must not be walked. - walk_
up_ to walk_with_specswith no specs, keeping at mostcapfiles.- walk_
with_ specs - Walk
rootfor datasets, handing batches toemit;emitreturnsfalseto abandon the walk. Blocks on the filesystem: never call from the drawing thread. Keeps 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 mostcrate::home::discover::MAX_SNIFFS_PER_DIRof them a directory.