pub struct ShadowProbe { /* private fields */ }Expand description
A directory listing turned around: which of its files are conventionally named sidecars, and for what.
The lookup used to run the other way — build all six <payload>.<ext>
candidates for a file and ask an ordered set of the listing whether it holds
any of them. That is six PathBuf allocations and six ordered-set probes
per file scanned, to answer “no” in every workspace with no attachments in
it; over twenty thousand documents it was 16% of a check, most of it
comparing paths component by component inside the set.
Inverting it costs one pass over the listing — the same
<payload>.<ext> convention read backwards, so the two are exact inverses —
and leaves the per-file question a single hash lookup that usually misses.
A workspace with no attachments builds an empty map and every probe is that
miss.
The content pointer is still what confirms a hit
(Graph::sidecar_claims); this only says which files are worth asking
about.
Implementations§
Source§impl ShadowProbe
impl ShadowProbe
Sourcepub fn over<'a>(listing: impl IntoIterator<Item = &'a PathBuf>) -> Self
pub fn over<'a>(listing: impl IntoIterator<Item = &'a PathBuf>) -> Self
Index the workspace-relative files a scan enumerated.
Trait Implementations§
Source§impl Clone for ShadowProbe
impl Clone for ShadowProbe
Source§fn clone(&self) -> ShadowProbe
fn clone(&self) -> ShadowProbe
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more