Skip to main content

scan

Function scan 

Source
pub fn scan(dir: &Path) -> Result<RecordScan, String>
Expand description

Every .json entry of dir, read and parsed, with nothing created, re-moded or removed.

Session ids are time-ordered, so a lexical sort descending is chronological. Only the json extension is read: the staging file RunningGuard::write renames into place ends in .tmp, so a record mid-write is neither a record nor unreadable. A file is sorted into RecordScan::older_mur by its session_id and records_dir keys alone.

A dir that does not exist is an empty machine. The Err is any other failure to list it — a path that is a regular file, or one this user may not read — and names the path and the OS error.