Skip to main content

WatchHandler

Trait WatchHandler 

Source
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§

Source

fn on_change(&self, changes: &[FileChange]) -> ProbarResult<()>

Called when files change

Provided Methods§

Source

fn on_start(&self) -> ProbarResult<()>

Called when watch starts

Source

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".

Implementors§