pub struct FileWatcher { /* private fields */ }Expand description
Watches a directory tree for filesystem changes, filters them, debounces, and provides batched change events.
Implementations§
Source§impl FileWatcher
impl FileWatcher
pub fn new(root: &Path, filter: PathFilter) -> Result<Self, WatchError>
pub fn with_poll_interval( root: &Path, filter: PathFilter, interval: Duration, ) -> Result<Self, WatchError>
Sourcepub fn poll_changes(&mut self) -> Vec<RawChange>
pub fn poll_changes(&mut self) -> Vec<RawChange>
Poll for pending filesystem changes. Non-blocking: drains the receiver and returns all coalesced changes.
Auto Trait Implementations§
impl Freeze for FileWatcher
impl RefUnwindSafe for FileWatcher
impl Send for FileWatcher
impl !Sync for FileWatcher
impl Unpin for FileWatcher
impl UnsafeUnpin 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