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, result: DebounceEventResult) {
match result {
Ok(events) => events.iter().for_each(|event| println!("{event:?}")),
Err(errors) => errors.iter().for_each(|error| println!("{error:?}")),
}
}
}
Required Methods§
Sourcefn handle_event(&mut self, event: DebounceEventResult)
fn handle_event(&mut self, event: DebounceEventResult)
Handles an event.