3 releases
Uses new Rust 2024
| new 0.2.4 | Jan 27, 2026 |
|---|---|
| 0.2.3 | Jan 26, 2026 |
| 0.2.1 | Jan 26, 2026 |
#578 in Asynchronous
21KB
415 lines
Fsig
Filesystem signal crate for monitoring, debouncing, and filtering events.
fsig abstracts away the boilerplate of setting up file watchers, handling noisy OS events, and filtering relevant changes. It turns raw filesystem notifications into clean, deduplicated signals your application can act on.
Features
- Debouncing: Configurable time window to merge rapid successive events into one.
- Event Coalescing: Intelligent state machine that merges
Create→Modifysequences and handles OS-specific noise. - Glob Filtering: Include/exclude files using glob patterns with full
**recursive support (powered byglobset). - Hidden File Filtering: Automatically ignore dotfiles and dot-directories.
- Multi-Subscriber: Broadcast channel allows multiple consumers to receive the same events.
- Stream API:
futures::Streamintegration for ergonomic async iteration. - Watcher Groups: Manage multiple named watchers with a unified interface.
Usage Examples
Check the examples and tests directories for runnable code:
- Basic Usage:
examples/simple.rs- Monitor a directory and receive debounced events. - Watcher Lifecycle:
tests/integration.rs#test_watcher_lifecycle- Create, modify, and remove file events. - Watcher Groups:
tests/integration.rs#test_watcher_group- Manage multiple named watchers. - Hidden File Filtering:
tests/integration.rs#test_hidden_and_cancel- Ignore dotfiles and handle temp file noise. - Event Kind Filtering:
tests/integration.rs#test_event_kind_filter- Listen only for specific event types.
Installation
[dependencies]
fsig = { version = "0.2", features = ["full"] }
Feature Flags
| Feature | Description |
|---|---|
match |
Enable glob pattern filtering (Target::Filtered) |
stream |
Enable futures::Stream API via Watcher::stream() |
serde |
Derive Serialize/Deserialize for config types |
full |
All of the above |
License
Released under the MIT License © 2026 Canmi
Dependencies
~7–22MB
~176K SLoC