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§

source

fn handle_event(&mut self, event: DebounceEventResult)

Handles an event.

Implementations on Foreign Types§

source§

impl DebounceEventHandler for Sender<DebounceEventResult>

source§

impl DebounceEventHandler for Sender<DebounceEventResult>

Implementors§

source§

impl<F> DebounceEventHandler for Fwhere F: FnMut(DebounceEventResult) + Send + 'static,