pub struct FileWatcher { /* private fields */ }Expand description
A filesystem watcher that streams ChangeEvent values.
Implementations§
Source§impl FileWatcher
impl FileWatcher
Sourcepub fn new(root: &Path) -> Result<Self, WatcherError>
pub fn new(root: &Path) -> Result<Self, WatcherError>
Start watching root recursively. Returns a watcher that streams events.
§Errors
Returns WatcherError if the watcher cannot be created or the path
cannot be watched.
Sourcepub async fn next(&mut self) -> Option<ChangeEvent>
pub async fn next(&mut self) -> Option<ChangeEvent>
Await the next change event. Returns None when the watcher is dropped.
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