notify_debouncer_full

Trait DebounceEventHandler

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

Source

fn handle_event(&mut self, event: DebounceEventResult)

Handles an event.

Implementations on Foreign Types§

Source§

impl DebounceEventHandler for Sender<DebounceEventResult>

Implementors§

Source§

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