[−][src]Module xi_core_lib::watcher
Monitoring files and directories.
This module contains FileWatcher
and related types, responsible for
monitoring changes to files and directories. Under the hood it is a
thin wrapper around some concrete type provided by the
notify
crate; the implementation is
platform dependent, and may be using kqueue, fsevent, or another
low-level monitoring system.
Our wrapper provides a few useful features:
-
All
watch
calls are associated with aWatchToken
; this allows for the same path to be watched multiple times, presumably by multiple interested parties. events are delivered once-per token. -
There is the option (via
FileWatcher::watch_filtered
) to include a predicate along with a path, to filter paths before delivery. -
We are integrated with the xi_rpc runloop; events are queued as they arrive, and an idle task is scheduled.
Structs
FileWatcher | Wrapper around a |
WatchToken | Token provided to |
Constants
DEBOUNCE_WAIT_MILLIS | Delay for aggregating related file system events. |
Traits
Notify | A trait for types which can be notified of new events.
New events are accessible through the |
Type Definitions
EventQueue | |
PathFilter |