Skip to main content

Module search

Module search 

Source
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 query against index, keeping the best limit. With base from a prefix of query, 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; None without a working directory or on a filesystem that must not be walked.
walk_up_to
walk_with_specs with no specs, keeping at most cap files.
walk_with_specs
Walk root for datasets, handing batches to emit; emit returns false to abandon the walk. Blocks on the filesystem: never call from the drawing thread. Keeps the files formats reads 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::home::discover::MAX_SNIFFS_PER_DIR of them a directory.