pub struct ScanRegistry {
pub entries: Vec<RegistryEntry>,
}Expand description
Persistent on-disk index of all past scans for this workspace.
Stored as registry.json adjacent to the scan output directories.
Fields§
§entries: Vec<RegistryEntry>Implementations§
Source§impl ScanRegistry
impl ScanRegistry
Sourcepub fn load(registry_path: &Path) -> Self
pub fn load(registry_path: &Path) -> Self
Load from disk; returns an empty registry on missing file or parse error.
Sourcepub fn save(&self, registry_path: &Path) -> Result<()>
pub fn save(&self, registry_path: &Path) -> Result<()>
§Errors
Returns an error if the parent directory cannot be created or the file cannot be written.
pub fn add_entry(&mut self, entry: RegistryEntry)
Sourcepub fn entries_for_roots(&self, roots: &[String]) -> Vec<&RegistryEntry>
pub fn entries_for_roots(&self, roots: &[String]) -> Vec<&RegistryEntry>
All entries whose input_roots exactly match, newest first.
pub fn find_by_run_id(&self, run_id: &str) -> Option<&RegistryEntry>
Sourcepub fn prune_stale(&mut self)
pub fn prune_stale(&mut self)
Remove entries whose json_path no longer exists on disk.
Sourcepub fn remove_entries_under(&mut self, dir: &Path) -> usize
pub fn remove_entries_under(&mut self, dir: &Path) -> usize
Remove every entry whose artifacts live under dir (the directory itself or any
descendant). Used when a watched folder is un-watched so its linked reports leave the
list too. Returns the number of entries removed.
Sourcepub fn retain_under_roots(&mut self, roots: &[PathBuf]) -> usize
pub fn retain_under_roots(&mut self, roots: &[PathBuf]) -> usize
Keep only entries whose artifacts live under one of roots — the currently-watched
folders plus the app’s own output directory. Everything else (leftovers from folders
that are no longer watched, or other external strays) is dropped. This enforces the
invariant that the report list reflects exactly the watched folders and native scans.
Returns the number of entries removed.