| Crates.io | dynpatch-watcher |
| lib.rs | dynpatch-watcher |
| version | 0.1.0 |
| created_at | 2025-10-15 10:50:57.146079+00 |
| updated_at | 2025-10-15 10:50:57.146079+00 |
| description | File watching and live config reloading for dynpatch |
| homepage | |
| repository | https://gitlab.com/TIVisionOSS/crates/dynpatch |
| max_upload_size | |
| id | 1884178 |
| size | 35,639 |
File watching and live config reloading for dynpatch.
notifyarc-swap for thread-safe config accessuse dynpatch_watcher::config::{HotConfig, watch};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize)]
struct AppConfig {
max_connections: usize,
log_level: String,
}
impl HotConfig for AppConfig {}
fn main() {
let watcher = watch::<AppConfig, _>("config.toml").unwrap();
loop {
let config = watcher.get();
println!("Max connections: {}", config.max_connections);
std::thread::sleep(std::time::Duration::from_secs(1));
}
}
json (default) - JSON format supporttoml (default) - TOML format supportyaml (default) - YAML format supportMIT - See LICENSE file for details