pub trait WatchHandler: Send + Sync {
// Required method
fn on_change(&self, changes: &[FileChange]) -> ProbarResult<()>;
// Provided methods
fn on_start(&self) -> ProbarResult<()> { ... }
fn on_stop(&self) -> ProbarResult<()> { ... }
}Expand description
Watch mode handler trait
Required Methods§
Sourcefn on_change(&self, changes: &[FileChange]) -> ProbarResult<()>
fn on_change(&self, changes: &[FileChange]) -> ProbarResult<()>
Called when files change
Provided Methods§
Sourcefn on_start(&self) -> ProbarResult<()>
fn on_start(&self) -> ProbarResult<()>
Called when watch starts
Sourcefn on_stop(&self) -> ProbarResult<()>
fn on_stop(&self) -> ProbarResult<()>
Called when watch stops
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".