pub struct WatchConfig {
pub paths: Vec<PathBuf>,
pub explicit_files: Vec<PathBuf>,
pub ignore: Vec<PathBuf>,
pub debounce: Duration,
pub retry_unchanged_when: Option<Arc<dyn Fn() -> bool + Send + Sync>>,
}Expand description
Configuration for spawn_watcher.
Fields§
§paths: Vec<PathBuf>Roots to watch recursively. Non-existent entries are silently skipped.
explicit_files: Vec<PathBuf>Exact files to watch through their parent directories.
These files bypass ignore filtering, which lets a manifest under an
ignored output directory act as an explicit synchronization point
without forwarding unrelated bundle writes.
ignore: Vec<PathBuf>Subtrees to ignore. An event is suppressed when its path lives
underneath any entry here. Typical values: the build’s out_dir,
node_modules, .git, target.
Each entry is canonicalized at registration time so symlink and
path-form differences (./dist vs dist) compare correctly.
debounce: DurationDebounce window — events arriving within this window are coalesced into a single callback invocation.
retry_unchanged_when: Option<Arc<dyn Fn() -> bool + Send + Sync>>Optional predicate that allows byte-identical file events through.
webui serve --watch uses this while a rebuild error is active so a
no-op save can retry transient failures. When the predicate returns
false (the common clean state), identical saves are still dropped.