Skip to main content

spawn

Function spawn 

Source
pub fn spawn(
    root: &Path,
    on_change: impl FnMut(Change) + Send + 'static,
) -> Result<RecommendedWatcher, Error>
Expand description

Spawn a recursive watcher on root; every translated change is handed to on_change (which the caller typically fires into a component sender).

The returned RecommendedWatcher must be kept alive for events to flow.