pub struct FileWatcher { /* private fields */ }Expand description
Main file watcher that can watch directories for changes
Implementations§
Source§impl FileWatcher
impl FileWatcher
Sourcepub fn new<F>(watch_dir: PathBuf, filter: F) -> Selfwhere
F: FileFilter + 'static,
pub fn new<F>(watch_dir: PathBuf, filter: F) -> Selfwhere
F: FileFilter + 'static,
Create a new file watcher
Sourcepub fn initialize(&mut self) -> Result<(), String>
pub fn initialize(&mut self) -> Result<(), String>
Initialize the watcher and scan for existing files
Sourcepub async fn start_watching(
&mut self,
) -> Result<Receiver<FileWatchEvent>, String>
pub async fn start_watching( &mut self, ) -> Result<Receiver<FileWatchEvent>, String>
Start watching the directory and return a receiver for processed events
Sourcepub fn get_watched_files(&self) -> &HashMap<String, FileBuffer>
pub fn get_watched_files(&self) -> &HashMap<String, FileBuffer>
Get current watched files (snapshot at initialization)
Auto Trait Implementations§
impl Freeze for FileWatcher
impl !RefUnwindSafe for FileWatcher
impl Send for FileWatcher
impl Sync for FileWatcher
impl Unpin for FileWatcher
impl !UnwindSafe for FileWatcher
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