pub struct FileChangeDetector {
pub base_dir: PathBuf,
pub include_patterns: Vec<String>,
pub exclude_patterns: Vec<String>,
}Expand description
File change detector.
Fields§
§base_dir: PathBufThe base directory to scan for changes.
include_patterns: Vec<String>The list of file patterns to include.
exclude_patterns: Vec<String>The list of file patterns to exclude.
Implementations§
Source§impl FileChangeDetector
impl FileChangeDetector
Sourcepub fn with_include_patterns(self, patterns: Vec<String>) -> Self
pub fn with_include_patterns(self, patterns: Vec<String>) -> Self
Sets the include patterns.
Sourcepub fn with_exclude_patterns(self, patterns: Vec<String>) -> Self
pub fn with_exclude_patterns(self, patterns: Vec<String>) -> Self
Sets the exclude patterns.
Sourcepub fn compute_file_hash(&self, path: &Path) -> Result<String>
pub fn compute_file_hash(&self, path: &Path) -> Result<String>
Computes the hash of a file.
Sourcepub fn scan_changes(
&self,
previous_state: Option<&HashMap<PathBuf, String>>,
) -> Result<Vec<FileChange>>
pub fn scan_changes( &self, previous_state: Option<&HashMap<PathBuf, String>>, ) -> Result<Vec<FileChange>>
Scans for file changes compared to a previous state.
Sourcepub fn generate_change_summary(&self, changes: &[FileChange]) -> String
pub fn generate_change_summary(&self, changes: &[FileChange]) -> String
Generates a summary of the changes.
Auto Trait Implementations§
impl Freeze for FileChangeDetector
impl RefUnwindSafe for FileChangeDetector
impl Send for FileChangeDetector
impl Sync for FileChangeDetector
impl Unpin for FileChangeDetector
impl UnsafeUnpin for FileChangeDetector
impl UnwindSafe for FileChangeDetector
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