Skip to main content

watch_paths

Function watch_paths 

Source
pub fn watch_paths<F>(
    paths: Vec<PathBuf>,
    poll_interval: Duration,
    on_change: F,
) -> WatchHandle
where F: Fn() + Send + Sync + 'static,
Expand description

Watch paths for mtime changes, invoking on_change whenever any watched path changes (content or existence). Missing paths are tracked too: creating or deleting a watched path fires on_change.

Poll failures are tolerated: the watcher waits FS_WATCH_RETRY_DELAY_MS and retries, never panicking (native watchWithErrorHandler).