Skip to main content

Module mtime_cache

Module mtime_cache 

Source
Expand description

Generic per-path, mtime-gated file cache shared by every ecosystem config-file cache (deps-cargo’s .cargo/config.toml/$CARGO_HOME/config.toml, deps-npm’s .npmrc).

MtimeFileCache<T> caches raw, unvalidated parse results, keyed by file path and invalidated by mtime — validation, environment-variable expansion, and policy gating are expected to run per call against the cached raw value, never cached themselves, so a didChangeConfiguration policy change or an environment-variable change takes effect immediately with no cache invalidation of its own. That split is the caller’s responsibility: this cache only knows how to keep one path’s T fresh.

Structs§

MtimeFileCache
Per-path memoization of a file’s parsed contents, invalidated by mtime.

Constants§

DEFAULT_MAX_CACHED_FILES
Upper bound on a MtimeFileCache’s entry count.
MAX_CACHED_FILE_BYTES
Maximum file size MtimeFileCache::get_or_parse reads before parsing.