pub struct FileSystemMonitor { /* private fields */ }Expand description
File system monitor for detecting file operations
Monitors file system for create, modify, delete, rename, move, and read operations. Emits events when operations are detected.
Implementations§
Source§impl FileSystemMonitor
impl FileSystemMonitor
Sourcepub fn emit_file_created(&self, path: PathBuf, size: u64) -> FileOperationEvent
pub fn emit_file_created(&self, path: PathBuf, size: u64) -> FileOperationEvent
Sourcepub fn emit_file_modified(
&self,
path: PathBuf,
old_hash: String,
new_hash: String,
) -> FileOperationEvent
pub fn emit_file_modified( &self, path: PathBuf, old_hash: String, new_hash: String, ) -> FileOperationEvent
Sourcepub fn emit_file_deleted(&self, path: PathBuf) -> FileOperationEvent
pub fn emit_file_deleted(&self, path: PathBuf) -> FileOperationEvent
Sourcepub fn emit_file_renamed(
&self,
old_path: PathBuf,
new_path: PathBuf,
) -> FileOperationEvent
pub fn emit_file_renamed( &self, old_path: PathBuf, new_path: PathBuf, ) -> FileOperationEvent
Sourcepub fn emit_file_moved(
&self,
old_path: PathBuf,
new_path: PathBuf,
) -> FileOperationEvent
pub fn emit_file_moved( &self, old_path: PathBuf, new_path: PathBuf, ) -> FileOperationEvent
Sourcepub fn emit_file_read(&self, path: PathBuf) -> FileOperationEvent
pub fn emit_file_read(&self, path: PathBuf) -> FileOperationEvent
Sourcepub fn emit_directory_created(&self, path: PathBuf) -> DirectoryOperationEvent
pub fn emit_directory_created(&self, path: PathBuf) -> DirectoryOperationEvent
Sourcepub fn emit_directory_deleted(&self, path: PathBuf) -> DirectoryOperationEvent
pub fn emit_directory_deleted(&self, path: PathBuf) -> DirectoryOperationEvent
Sourcepub async fn track_file_hash(&self, path: PathBuf, hash: String)
pub async fn track_file_hash(&self, path: PathBuf, hash: String)
Track a file hash for modification detection
§Arguments
path- Path to the filehash- Hash of the file content
Sourcepub async fn get_file_hash(&self, path: &PathBuf) -> Option<String>
pub async fn get_file_hash(&self, path: &PathBuf) -> Option<String>
Sourcepub async fn remove_file_hash(&self, path: &PathBuf)
pub async fn remove_file_hash(&self, path: &PathBuf)
Sourcepub async fn clear_file_hashes(&self)
pub async fn clear_file_hashes(&self)
Clear all tracked file hashes
Trait Implementations§
Source§impl Clone for FileSystemMonitor
impl Clone for FileSystemMonitor
Source§fn clone(&self) -> FileSystemMonitor
fn clone(&self) -> FileSystemMonitor
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 FileSystemMonitor
impl Debug for FileSystemMonitor
Auto Trait Implementations§
impl Freeze for FileSystemMonitor
impl !RefUnwindSafe for FileSystemMonitor
impl Send for FileSystemMonitor
impl Sync for FileSystemMonitor
impl Unpin for FileSystemMonitor
impl !UnwindSafe for FileSystemMonitor
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