pub struct FileWatcher { /* private fields */ }Expand description
Watches a directory for file changes.
Implementations§
Source§impl FileWatcher
impl FileWatcher
Sourcepub fn new(root: &Path) -> Result<Self, Error>
pub fn new(root: &Path) -> Result<Self, Error>
Creates a new file watcher for the given directory.
Returns a watcher that produces FileChange events when source files are modified.
Sourcepub fn poll(&self) -> Vec<FileChange>
pub fn poll(&self) -> Vec<FileChange>
Polls for file changes.
Returns immediately with any pending changes.
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Option<FileChange>
pub fn recv_timeout(&self, timeout: Duration) -> Option<FileChange>
Waits for the next file change with a timeout.
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