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.
Trait Implementations§
Source§impl Debug for ScanRegistry
impl Debug for ScanRegistry
Source§impl Default for ScanRegistry
impl Default for ScanRegistry
Source§fn default() -> ScanRegistry
fn default() -> ScanRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ScanRegistry
impl<'de> Deserialize<'de> for ScanRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ScanRegistry
impl RefUnwindSafe for ScanRegistry
impl Send for ScanRegistry
impl Sync for ScanRegistry
impl Unpin for ScanRegistry
impl UnsafeUnpin for ScanRegistry
impl UnwindSafe for ScanRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more