Skip to main content

StatCache

Trait StatCache 

Source
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§

Source

fn entry(&self, path: &SourcePath) -> Option<StatEntry>

What was recorded for path, if anything.

Source

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.

Source

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".

Implementors§