watchr_filesystem 0.1.0

A simple file watcher that watches a list of paths and calls a callback when any of them change
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use watchr_filesystem::{Event, FileWatcher};

use std::path::PathBuf;

fn main() {
    // Watch the destination folder in the current directory for changes
    let watcher = FileWatcher::new(vec![PathBuf::from("./destination")]);

    // Run the watcher
    let _ = watcher.watch(log_event);
}

fn log_event(event: Event) {
    println!("Event type: {:?}, Path: {:?}", event.kind, event.paths[0]);
}