Expand description
On-disk index of cached assets (index.json).
The index is a plain JSON file persisted alongside the cache directory. It stores the metadata that must survive process restarts:
- Map of
asset_id -> CachedAsset(filename, size, checksum, context, …) last_accessedtimestamps used by the LRU rotator
Writes go through a temp file + rename for atomicity, so that a crash mid-write cannot leave a half-written index on disk.
Structs§
- Asset
Index - In-memory representation of the
index.jsonfile. - Cached
Asset - A single cached asset as persisted in the index.
- NewCached
Asset - Parameters accepted by
CachedAsset::new.
Constants§
- INDEX_
FILENAME - Filename of the on-disk index, relative to the cache root.
- INDEX_
VERSION - Current schema version — bumped when breaking changes are made.
Functions§
- now_ms
- Current time as UNIX epoch milliseconds.