pub struct CacheData {
pub cache_version: String,
pub directory: String,
pub file_snapshot: Vec<SnapshotItem>,
pub match_operations: Vec<OpItem>,
pub created_at: u64,
pub ai_model_used: String,
pub config_hash: String,
pub original_relocation_mode: String,
pub original_backup_enabled: bool,
}Expand description
Dry-run cache data structure containing snapshot and match history.
Stores the complete state of a directory scan and match operations, enabling efficient incremental processing and result caching.
Fields§
§cache_version: StringVersion of the cache format for compatibility checking
directory: StringPath to the directory that was processed
file_snapshot: Vec<SnapshotItem>Snapshot of all files found during scanning
match_operations: Vec<OpItem>List of all match operations performed
created_at: u64Timestamp when the cache was created
ai_model_used: StringAI model used for matching operations
config_hash: StringHash of configuration used for matching
original_relocation_mode: StringRecords the relocation mode when the cache was generated
original_backup_enabled: boolRecords whether backup was enabled when the cache was generated
Implementations§
Source§impl CacheData
impl CacheData
Sourcepub fn has_empty_snapshot(&self) -> bool
pub fn has_empty_snapshot(&self) -> bool
Returns true when the cache carries no file snapshot entries.
Legacy caches generated before snapshot population was implemented
will report true; callers should treat such caches as unable to
perform freshness validation.
Sourcepub fn validate_snapshot(&self) -> Vec<StaleFile>
pub fn validate_snapshot(&self) -> Vec<StaleFile>
Validates every snapshot entry against the current filesystem state.
Returns a list of StaleFile records describing each file whose
on-disk state diverges from the snapshot (missing, size mismatch, or
modification-time mismatch). An empty result indicates that the
snapshot is still consistent with the filesystem.
Sourcepub fn validate_target_paths(&self) -> Vec<PathBuf>
pub fn validate_target_paths(&self) -> Vec<PathBuf>
Checks whether any planned subtitle target path already exists on disk.
For every cached operation, the target path is computed based on the
recorded relocation mode: when the mode is anything other than
"None", the target resides next to the video file; otherwise it
stays alongside the original subtitle file. Returns the list of
target paths that already exist and would therefore conflict with
applying the cached plan.