Expand description
Multi-volume engine assembly.
Owns one VolumeIndex per NTFS volume, drives initial scans and USN
tailing threads, and answers queries with a k-way-merged, sort-ordered
result set (docs/ARCHITECTURE.md). This is the layer the FFI exposes 1:1
— and the layer a v2 service would host.
Modules§
- results 🔒
- seams 🔒
- The engine’s only two OS-effect seams (ADR-0018 — this is the hard cap,
do not add a third): snapshot persistence and the USN journal session.
They exist so the volume worker’s failure paths (corrupt snapshot,
journal-gone, failed saves, stat-fetch storms) replay in unprivileged,
deterministic tests (
worker_tests.rs). The Windows implementations are thin wrappers over the exact calls the worker made before the seam was introduced — behavior-identical by construction. - search 🔒
- volume 🔒
- Per-volume state: the slot the engine and the worker thread share
(
VolumeSlot), the index install rule, the journal checkpoint, and the snapshot save helper. The thread that drives the flow lives inworker.rs; the OS-effect seams it runs against live inseams.rs. - watch 🔒
- Scope-mode change source (ADR-0024), the
JournalSourcesecond implementation that pairs with the folder-walk scanner. - worker 🔒
- The volume worker: the thread that drives one volume through
restore-or-scan → Ready → USN tailing → (journal-gone) rescan, forever.
volume.rsis the state’s home (VolumeSlot, checkpoint, save helper); this file is the flow’s home. Decisions are pure functions; effects (counters, logs, events, installs, saves) stay in the loop, keyed off the decisions — that split is what letsworker_tests.rsreplay the failure paths deterministically without elevation (ADR-0018, S4b).
Structs§
- Engine
- The multi-volume engine: owns one index per NTFS volume, drives scans and USN tailing, and answers queries. Holds the single-writer lock for its whole lifetime.
- Engine
Config - Engine startup configuration.
- Result
Set - Materialized, sort-ordered result. Pages are O(1) slices; reads stay
valid across content mutations and fail with
Staleonly after a structural change (compaction/rescan). - Row
- One row handed across the FFI: everything the UI list needs.
Enums§
- Engine
Create Error - Why
Engine::newrefused to start.Lockedis the cross-process arm of the single-writer invariant (FFI:FMF_E_LOCKED, docs/ARCHITECTURE.md Pipe protocol §single-writer exclusion). - Engine
Error - A failure answering a query (parse, compile, or a stale result set).
- Engine
Event - Asynchronous notification a volume emits to the event sink during scanning
and tailing (mapped 1:1 to a contract POD by
EngineEvent::to_wire). - Volume
State - Lifecycle state of a volume’s index (
FmfVolumeStatus.state).
Type Aliases§
- Event
Sink - Callback the engine invokes (from any thread) to deliver an
EngineEvent.