pub trait StatCache {
// Required methods
fn entry(&self, path: &SourcePath) -> Option<StatEntry>;
fn record(&mut self, path: SourcePath, entry: StatEntry);
fn commit(&mut self) -> Result<()>;
}Expand description
Holds, for each file hashed before, its digest and the metadata it was hashed under.
Required Methods§
Sourcefn entry(&self, path: &SourcePath) -> Option<StatEntry>
fn entry(&self, path: &SourcePath) -> Option<StatEntry>
What was recorded for path, if anything.
Sourcefn record(&mut self, path: SourcePath, entry: StatEntry)
fn record(&mut self, path: SourcePath, entry: StatEntry)
Replaces the entry for path, in memory.
An implementation may decline to keep an entry it cannot vouch for;
entry then returns None for that path.
Sourcefn commit(&mut self) -> Result<()>
fn commit(&mut self) -> Result<()>
Persists every entry.
§Errors
Returns Error::Adapter, naming
PortName::StatCache, when the entries cannot be stored.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".