Skip to main content

walker/
checkpoint.rs

1use serde::{Deserialize, Serialize};
2use std::path::PathBuf;
3
4/// Resume cursor for a single root (path + hash of walk/filter config).
5#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
6pub struct Checkpoint {
7    pub root: PathBuf,
8    pub last_path: Option<PathBuf>,
9    /// Stable hash of filter options + version byte so checkpoints do not cross incompatible configs.
10    pub config_hash: u64,
11}
12
13impl Checkpoint {
14    pub fn new(root: PathBuf, config_hash: u64) -> Self {
15        Self {
16            root,
17            last_path: None,
18            config_hash,
19        }
20    }
21}