pub struct ChangeDetector { /* private fields */ }Expand description
Tracks file modifications for cache invalidation
Implementations§
Source§impl ChangeDetector
impl ChangeDetector
Sourcepub fn record_mtimes(&mut self, root: &Path) -> Result<(), ResearchError>
pub fn record_mtimes(&mut self, root: &Path) -> Result<(), ResearchError>
Record the current modification times of files in a directory
Sourcepub fn should_skip(&self, path: &Path) -> bool
pub fn should_skip(&self, path: &Path) -> bool
Check if a path should be skipped during scanning
Sourcepub fn detect_changes(
&self,
root: &Path,
) -> Result<ChangeDetection, ResearchError>
pub fn detect_changes( &self, root: &Path, ) -> Result<ChangeDetection, ResearchError>
Detect changes since the last recording
Sourcepub fn recorded_mtimes(&self) -> &HashMap<PathBuf, SystemTime>
pub fn recorded_mtimes(&self) -> &HashMap<PathBuf, SystemTime>
Get the recorded modification times
Sourcepub fn tracked_file_count(&self) -> usize
pub fn tracked_file_count(&self) -> usize
Get the number of tracked files
Trait Implementations§
Source§impl Clone for ChangeDetector
impl Clone for ChangeDetector
Source§fn clone(&self) -> ChangeDetector
fn clone(&self) -> ChangeDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChangeDetector
impl Debug for ChangeDetector
Auto Trait Implementations§
impl Freeze for ChangeDetector
impl RefUnwindSafe for ChangeDetector
impl Send for ChangeDetector
impl Sync for ChangeDetector
impl Unpin for ChangeDetector
impl UnwindSafe for ChangeDetector
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