MCPcopy Create free account
hub / github.com/anelson/tracers / cache_file_computation

Function cache_file_computation

tracers-codegen/src/cache.rs:18–59  ·  view source on GitHub ↗

Given the path to a file, and a function that takes as an argument a `String` with the contents of that file and returns the (serializable) result of some computation on those contents, implements a cache whereby first the cache directory is checked to see if a previous operation has been attempted on the same file contents. If found, that version is returned and the function is never invoked.

(
    cache_path: &Path,
    input_path: &Path,
    key: &str,
    f: F,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

caches_file_resultsFunction · 0.85
process_fileFunction · 0.85

Calls 3

hash_bufFunction · 0.85
cached_results_pathFunction · 0.85
cache_generated_fileFunction · 0.85

Tested by 1

caches_file_resultsFunction · 0.68