pub trait DebounceEventHandler: Send + 'static {
// Required method
fn handle_event(&mut self, event: DebounceEventResult);
}
Expand description
The set of requirements for watcher debounce event handling functions.
Example implementation
/// Prints received events
struct EventPrinter;
impl DebounceEventHandler for EventPrinter {
fn handle_event(&mut self, event: DebounceEventResult) {
match event {
Ok(events) => {
for event in events {
println!("Event {:?} for path {:?}",event.kind,event.path);
}
},
// errors are immediately reported
Err(error) => println!("Got error {:?}",error),
}
}
}
Required Methods§
sourcefn handle_event(&mut self, event: DebounceEventResult)
fn handle_event(&mut self, event: DebounceEventResult)
Handles an event.