MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / cache_path

Function cache_path

native/shared/src/sdf_cache.rs:134–140  ·  view source on GitHub ↗

Resolve a hash to its cache file path, creating the cache root if needed. Returns `None` if the cache dir can't be created.

(hash: MeshHash)

Source from the content-addressed store, hash-verified

132/// Resolve a hash to its cache file path, creating the cache root if
133/// needed. Returns `None` if the cache dir can't be created.
134fn cache_path(hash: MeshHash) -> Option<PathBuf> {
135 let dir = cache_dir()?;
136 if !dir.exists() {
137 fs::create_dir_all(&dir).ok()?;
138 }
139 Some(dir.join(hash.to_filename()))
140}
141
142/// Look up cached voxel bytes. Returns `Some(bytes)` only when the
143/// file exists, parses, and matches the expected magic + version +

Callers 4

loadFunction · 0.85
storeFunction · 0.85
load_miss_returns_noneFunction · 0.85

Calls 2

cache_dirFunction · 0.85
to_filenameMethod · 0.80

Tested by 2

load_miss_returns_noneFunction · 0.68