pub struct WatchConfig {
pub paths: 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.
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.
Auto Trait Implementations§
impl !RefUnwindSafe for WatchConfig
impl !UnwindSafe for WatchConfig
impl Freeze for WatchConfig
impl Send for WatchConfig
impl Sync for WatchConfig
impl Unpin for WatchConfig
impl UnsafeUnpin for WatchConfig
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