neco-watchnorm
neco-watchnorm normalizes host-specific file watcher events into a deterministic batch API for downstream runtime logic.
Event normalization
The crate accepts host-side watcher events as RawWatchEvent, then converts them into a smaller normalized event stream during drain(). Callers provide a generation number, and the normalizer drops stale events, joins rename halves when possible, and keeps incomplete rename information as PartialRename instead of guessing.
Modify coalescing is conservative. Repeated modifies for the same path collapse, an immediate modify after create is absorbed, and removes discard earlier modifies for the same path in the current batch.
Usage
use ;
let mut normalizer = new;
normalizer.push;
normalizer.push;
let result = normalizer.drain;
assert_eq!;
assert!;
API
| Item | Description |
|---|---|
RawWatchEvent |
Host-agnostic batch input event with generation metadata |
RawWatchKind |
Raw create / remove / modify / rename discriminator |
RenameHint |
Optional rename-side hint from the host bridge |
NormalizedWatchEvent |
Consumer-facing normalized event with generation |
NormalizedWatchKind |
Create, Remove, Modify, Rename, and PartialRename |
WatchBatchNormalizer |
Stateful batch normalizer with push and drain |
FlushResult |
Normalized output events and stale discard count |
License
MIT