Skip to main content

FileStatisticsCache

Trait FileStatisticsCache 

Source
pub trait FileStatisticsCache: CacheAccessor<Path, CachedFileMetadata> {
    // Required method
    fn list_entries(&self) -> HashMap<Path, FileStatisticsCacheEntry>;
}
Expand description

A cache for file statistics and orderings.

This cache stores CachedFileMetadata which includes:

  • File metadata for validation (size, last_modified)
  • Statistics for the file
  • Ordering information for the file

If enabled via CacheManagerConfig::with_files_statistics_cache this cache avoids inferring the same file statistics repeatedly during the session lifetime.

The typical usage pattern is:

  1. Call get(path) to check for cached value
  2. If Some(cached), validate with cached.is_valid_for(&current_meta)
  3. If invalid or missing, compute new value and call put(path, new_value)

See crate::runtime_env::RuntimeEnv for more details

Required Methods§

Source

fn list_entries(&self) -> HashMap<Path, FileStatisticsCacheEntry>

Retrieves the information about the entries currently cached.

Trait Implementations§

Source§

impl Debug for dyn FileStatisticsCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§