Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
zccache-watcher
Cross-platform file watching for zccache.
This crate currently has two layers:
- a public Rust crate API used by the daemon watcher pipeline
- an optional
pythonfeature that exposes a Rust-backed polling engine tozccache.watcher
Those layers solve different problems. The Rust crate API is built around the
daemon's notify-driven event pipeline and also exposes a public polling
watcher for library-style use. The Python package binds to that Rust polling
watcher and delivers events to Python through polling or callbacks.
Rust API
The public Rust surface is intended for daemon and systems integration code.
Available types:
PollingWatcherConfigPollingWatcherPollWatchBatchPollWatchObserverIgnoreFilterNotifyWatcherSettleBufferSettledEventOverflowRecoveryWatchEventWatcherConfig
Polling watcher flow:
- Build a
PollingWatcherConfig - Create a
PollingWatcher - Call
start() - Consume batches with
poll()/poll_timeout() - Optionally register observers with
add_observer()oradd_callback() - Call
stop()orresume()as needed
use ;
use Duration;
use ;
let mut config = new;
config.include_globs = vec!;
config.excluded_patterns = vec!;
config.poll_interval = from_millis;
config.debounce = from_millis;
let watcher = new?;
let seen = new;
let seen_clone = clone;
watcher.add_callback?;
watcher.start?;
let batch = watcher.poll_timeout?;
watcher.stop?;
# let _ = batch;
Daemon pipeline flow:
- Create an
IgnoreFilter - Create a
NotifyWatcher - Register directories with
watch()orwatch_recursive() - Feed the returned raw event receiver into
SettleBuffer::run() - Consume
SettledEvent::Batch/SettledEvent::Overflow
use Arc;
use mpsc;
use ;
async
Notes:
PollingWatcheris the public Rust API closest to the Python watcher surface.resume()resets the baseline, matching the Python watcher lifecycle semantics.NotifyWatcherremains the lower-level public Rust entrypoint for the daemon pipeline.WatcherConfigcurrently carries settle-window and ignore-pattern defaults used by the daemon-oriented watcher pipeline.
Python API
The Python package is published as zccache.watcher.
It supports:
- polling-style user APIs
- callback-style user APIs
- explicit
start(),stop(), andresume()lifecycle control - context-manager usage
- internal Rust worker polling to avoid OS event queue saturation
include_foldersto limit scan scopeinclude_globsto select files by globexcluded_patternsto skip files or whole directoriesnotification_predicatefor late-binding Python-side filteringdebounce_secondsto coalesce rapid edits
Polling API
=
=
Late-Binding Predicate Filter
return not
=
The predicate runs after the internal scan has detected a pending change but
before the event is delivered to poll() or callbacks. Return True to keep
the notification and False to suppress it.
Callback API
=
Lifecycle-Controlled Class API
=
=
KeyboardInterrupt Handling
The Python wrapper logs KeyboardInterrupt: watcher stopped once per watcher
instance when delivery is interrupted. Interrupt propagation is thread-aware:
- on the main thread, the original
KeyboardInterruptis re-raised - on a worker thread, the wrapper notifies the main thread with
_thread.interrupt_main()
fastled-wasm Compatibility
The package keeps the compatibility names used by fastled-wasm:
FileWatcherProcessDebouncedFileWatcherProcessfile_watcher_enabled()file_watcher_set()
FileWatcherProcess.get_all_changes() remains the simplest drop-in polling API.
CLI Relationship
If you only need a "did anything relevant change?" answer instead of a file
event stream, use the main zccache CLI fingerprint API:
Related commands:
zccache fp --cache-file .cache/inputs.json mark-successzccache fp --cache-file .cache/inputs.json mark-failurezccache fp --cache-file .cache/inputs.json invalidate
That CLI path is daemon-backed and optimized for build-step invalidation rather than event delivery.