pub struct Watcher { /* private fields */ }Expand description
A file-system watcher that detects changes in a directory tree and batches them into debounced event batches.
Implementations§
Source§impl Watcher
impl Watcher
Sourcepub fn new(root: &Path) -> Self
pub fn new(root: &Path) -> Self
Create a new watcher for the given root directory.
The watcher is not started yet; call Watcher::start to begin
receiving events.
Sourcepub fn start(&mut self) -> Result<Receiver<Vec<PathBuf>>>
pub fn start(&mut self) -> Result<Receiver<Vec<PathBuf>>>
Start watching the file system for changes.
§Errors
Returns an error if the filesystem watcher cannot be created.
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Returns true while the underlying notify watcher is active.
Auto Trait Implementations§
impl Freeze for Watcher
impl !RefUnwindSafe for Watcher
impl Send for Watcher
impl Sync for Watcher
impl Unpin for Watcher
impl UnsafeUnpin for Watcher
impl !UnwindSafe for Watcher
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more