Struct PollWatcher
pub struct PollWatcher { /* private fields */ }
A Watcher that detects changes by periodically scanning paths.
Compares modification times and file sizes by default. Enable
Config::with_compare_contents to also compare file contents.
Create and remove events distinguish regular files (File), directories (Folder), and
other entries (Other). With Config::with_follow_symlinks enabled, symlinks are classified
by their targets; otherwise they are Other. Removal events use the last observed type.
Implementations
impl PollWatcher
fn new<F: EventHandler>(event_handler: F, config: Config) -> Result<PollWatcher>Create a new
PollWatcher, configured as needed.fn poll(&self) -> Result<()>Actively poll for changes. Can be combined with a timeout of 0 to perform only manual polling.
fn poll_blocking(&self) -> Result<()>Actively poll for changes and block until the poll cycle has completed.
This is primarily useful together with
Config::with_manual_polling.fn with_initial_scan<F: EventHandler, G: ScanEventHandler>(event_handler: F, config: Config, scan_callback: G) -> Result<PollWatcher>Create a new
PollWatcherwith an scan event handler.scan_fallbackis called on the initial scan with all files seen by the pollwatcher.
Trait Implementations
impl Debug for PollWatcher
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Drop for PollWatcher
fn drop(&mut self)
impl Watcher for PollWatcher
fn new<F: EventHandler>(event_handler: F, config: Config) -> Result<Self>Create a new
PollWatcher.fn watch(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<()>fn watch_with(&mut self, path: &Path, config: WatchPathConfig) -> Result<()>fn unwatch(&mut self, path: &Path) -> Result<()>fn watched_paths(&self) -> Result<Vec<WatchedPath>>fn kind() -> WatcherKind