Skip to main content

newest_event

Function newest_event 

Source
pub fn newest_event(path: &Path) -> Option<(DateTime<Utc>, Option<PathBuf>)>
Expand description

Read up to ~64 KiB from the end of path, find the newest line that parses as JSON with a timestamp field, and return both the timestamp and the optional cwd field from that same event (parsed in a single pass).

Returns None for empty files, files containing only metadata events without timestamp, or unreadable / unparseable files.