hot
hotwatch
cargo install hotwatch
hot

hotwatch

A Rust library for conveniently watching and handling file changes.

by Francesca Lovebloom

0.4.5 (see all)License:Apache-2.0/MIT
cargo install hotwatch
Readme

hotwatch

Crates.io Docs.rs Build Status

hotwatch is a Rust library for comfortably watching and handling file changes. It's a thin convenience wrapper over notify, allowing you to easily set callbacks for each path you want to watch.

Only the latest stable version of Rust is supported.

use hotwatch::{Hotwatch, Event};

let mut hotwatch = Hotwatch::new().expect("hotwatch failed to initialize!");
hotwatch.watch("war.png", |event: Event| {
    if let Event::Write(path) = event {
        println!("War has changed.");
    }
}).expect("failed to watch file!");

Why should I use this instead of warmy?

warmy is a more general solution for responding to resource changes. hotwatch is very simplistic and intends to be trivial to integrate.

I've never actually used warmy, though. It's probably awesome. I just know that hotwatch is really easy to use and has a sexy name.

GitHub Stars

62

LAST COMMIT

8mos ago

MAINTAINERS

1

CONTRIBUTORS

6

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
0.4.5
2yrs ago
0.4.4
2yrs ago
0.4.3
3yrs ago
0.4.2
3yrs ago
No alternatives found
No tutorials found
Add a tutorial