pub fn spawn_watcher<F>(cfg: WatchConfig, on_event: F) -> Result<WatcherHandle>Expand description
Start a debounced recursive watcher.
The closure on_event is invoked once per debounce window with the
owned, deduplicated list of paths that changed outside any
cfg.ignore root. If every event in a window targets an ignored
subtree, the callback is not invoked.
Non-existent paths in cfg.paths are silently skipped; this matches
the dev-server use case where some watched directories (e.g. an
optional public/) may not exist yet.
ยงErrors
Returns an error if the watcher cannot be created or if a path that exists cannot be watched (typically a permissions issue).