pub struct FirstReads { /* private fields */ }Expand description
The first reads of a run: for each path whose first read or run of a regular
file came before any write of that path in the run, the file’s
FileMetadata at that moment, in sorted path order.
A tracer notes a file when the command opens it for reading or runs it, and the kernel’s loads of interpreters and loaders count as runs. It notes nothing for a path that the command wrote earlier in the run, for a path it already noted, and for a call that created or truncated the file, which writes it first.
Implementations§
Source§impl FirstReads
impl FirstReads
Sourcepub fn is_first(&self, path: &AbsolutePath, accesses: &Accesses) -> bool
pub fn is_first(&self, path: &AbsolutePath, accesses: &Accesses) -> bool
Whether a read or run of path now would be its first read: the path has
no note yet, and accesses, every access recorded earlier in the run, shows
no write of it.
Sourcepub fn note(
&mut self,
path: &AbsolutePath,
metadata: FileMetadata,
accesses: &Accesses,
) -> bool
pub fn note( &mut self, path: &AbsolutePath, metadata: FileMetadata, accesses: &Accesses, ) -> bool
Note metadata as the first-read metadata of path, which the command is
reading or running now, when that is its first read by
FirstReads::is_first; return whether it was noted.
Sourcepub fn note_at(&mut self, path: &AbsolutePath, accesses: &Accesses) -> bool
pub fn note_at(&mut self, path: &AbsolutePath, accesses: &Accesses) -> bool
Note the metadata of the regular file at path, read now with
FileMetadata::at, under the rules of FirstReads::note; nothing is
noted when path names no regular file. Return whether it was noted.
A tracer calls it when the command reads or runs path, before it records
that access in accesses.
Sourcepub fn get(&self, path: &AbsolutePath) -> Option<&FileMetadata>
pub fn get(&self, path: &AbsolutePath) -> Option<&FileMetadata>
The first-read metadata of path, if it was noted.
Sourcepub fn iter(&self) -> Iter<'_, AbsolutePath, FileMetadata> ⓘ
pub fn iter(&self) -> Iter<'_, AbsolutePath, FileMetadata> ⓘ
The noted paths with their first-read metadata, in sorted path order.