Debian Codegraph @

/

debian rust-dirty-tracker 0.3.0-5debian librust-dirty-tracker-dev debian librust-dirty-tracker+default-dev debian librust-dirty-tracker-0-dev debian librust-dirty-tracker-0+default-dev debian librust-dirty-tracker-0.3-dev debian librust-dirty-tracker-0.3+default-dev debian librust-dirty-tracker-0.3.0-dev debian librust-dirty-tracker-0.3.0+default-dev cargo dirty-tracker 0.3.0 debianjsonmakefilemarkdownrustrustrust-c-abishelltomlyaml 18 files · 166 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • cargo, debhelper-compat, librust-notify-8+default-dev, librust-tempfile-3+default-dev, libstd-rust-dev, rustc
README (full)

Opportunistic dirty file tracker

This library provides a simple way to track dirty files in a directory. It uses the notify crate to watch for file system events and keep track of the files that have been modified.

If the underlying file system does not support watching for file system events, or if there are too many files to watch, the tracker will simply give up and return State::Unknown.

Example:

use dirty_tracker::{State, DirtyTracker};

let td = tempfile::tempdir().unwrap();

let mut tracker = DirtyTracker::new(td.path()).unwrap();
assert_eq!(tracker.state(), State::Clean);
assert!(tracker.paths().unwrap().is_empty());

// Modify a file in the directory.
std::fs::write(td.path().join("file"), b"hello").unwrap();

assert_eq!(tracker.state(), State::Dirty);
assert_eq!(tracker.paths(), Some(&maplit::hashset![td.path().join("file")]));
dir .github/
dir debian/
dir src/
file .cargo_vcs_info.json
file .gitignore
file Cargo.toml
file Cargo.toml.orig
file README.md