north-config 0.1.10

North config is a multi source configuration crate designed as part of the North Microservice Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use notify::{RecursiveMode, Watcher};
use std::path::Path;

pub fn watch_file_path(path: Box<Path>) -> Result<(), crate::Error> {
    // Automatically select the best implementation for your platform.
    let mut watcher = notify::recommended_watcher(|res| match res {
        Ok(event) => println!("event: {:?}", event),
        Err(e) => println!("watch error: {:?}", e),
    })
    .unwrap();

    watcher.watch(&path, RecursiveMode::Recursive).unwrap();

    Ok(())
}