Skip to main content

Module index

Module index 

Source
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_accessed timestamps 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§

AssetIndex
In-memory representation of the index.json file.
CachedAsset
A single cached asset as persisted in the index.
NewCachedAsset
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.