Trait notify::EventHandler
source · pub trait EventHandler: Send + 'static {
// Required method
fn handle_event(&mut self, event: Result<Event>);
}
Expand description
The set of requirements for watcher event handling functions.
§Example implementation
use notify::{Event, Result, EventHandler};
/// Prints received events
struct EventPrinter;
impl EventHandler for EventPrinter {
fn handle_event(&mut self, event: Result<Event>) {
if let Ok(event) = event {
println!("Event: {:?}", event);
}
}
}
Required Methods§
sourcefn handle_event(&mut self, event: Result<Event>)
fn handle_event(&mut self, event: Result<Event>)
Handles an event.